com.ibm.tivoli.maximo.skd.common.util

Class SKDFormat

  • java.lang.Object
    • com.ibm.tivoli.maximo.skd.common.util.SKDFormat


  • public class SKDFormat
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String booleanToString(boolean b, java.util.Locale l)
      Converts a boolean value to a string value.
      java.lang.String convertToStoreYNValue(java.lang.String val, java.util.Locale l)
      Converts the YORN value to Store YORN value
      java.lang.String dateTimeToDisplayString(java.util.Date d, java.util.Locale l)
      Convert a date to a datetime string using the specified locale and time zone.
      java.lang.String dateTimeToDisplayString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to a datetime string using the specified locale and time zone.
      java.lang.String dateTimeToParseString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to a parse datetime string using the specified locale and time zone.
      java.lang.String dateTimeToString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz) 
      java.lang.String dateToString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to a string using the specified locale and time zone.
      java.lang.String doubleToDuration(double d)
      Convert a double value to a string using the specified locale.
      java.lang.String doubleToString(double d, int places, java.util.Locale l, boolean groupingInFormat)
      Convert a double to a string, setting the number of decimal places using the specified locale.
      double durationToDouble(java.lang.String s, java.util.Locale l)
      Convert a duation string to a double value using the specified locale.
      static java.util.Date getDateOnly(java.util.Date date)
      Set time portion of passed date to 00:00:00
      java.lang.String getDatePattern() 
      java.lang.String getTimePattern() 
      int[] parseDateTime(java.lang.String s, java.util.Locale l, java.lang.String pattern)
      Break a date, datetime or time string into constituent parts.
      boolean stringToBoolean(java.lang.String s, java.util.Locale l)
      Convert a string to a boolean value specific locale
      java.util.Date stringToDate(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convert a string to a date using the specified locale and time zone
      java.util.Date stringToDateTime(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convet a datetime string to a date using the specified locale and time zone.
      double stringToDouble(java.lang.String s, java.util.Locale l)
      convert a double to string using the specified locale
      int stringToInt(java.lang.String s, java.util.Locale l)
      Convert a string to an integer using the specified locale
      java.util.Date stringToTime(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convert a time string to a date using the specified locale and time zone.
      java.lang.String timeToDisplayString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to time string using the specified locale and time zone.
      java.lang.String timeToParseString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to time string using the specified locale and time zone.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • stringToDate

        public java.util.Date stringToDate(java.lang.String s,
                                           java.util.Locale l,
                                           java.util.TimeZone tz)
                                    throws SKDAppletException
        Convert a string to a date using the specified locale and time zone
        Throws:
        SKDAppletException
      • parseDateTime

        public int[] parseDateTime(java.lang.String s,
                                   java.util.Locale l,
                                   java.lang.String pattern)
                            throws SKDAppletException
        Break a date, datetime or time string into constituent parts. Returns an array with containing values for day, month, year, hour, min, sec in that order.
        Throws:
        SKDAppletException
      • stringToInt

        public int stringToInt(java.lang.String s,
                               java.util.Locale l)
                        throws SKDAppletException
        Convert a string to an integer using the specified locale
        Throws:
        SKDAppletException
      • stringToDateTime

        public java.util.Date stringToDateTime(java.lang.String s,
                                               java.util.Locale l,
                                               java.util.TimeZone tz)
                                        throws SKDAppletException
        Convet a datetime string to a date using the specified locale and time zone.
        Throws:
        SKDAppletException
      • getDateOnly

        public static java.util.Date getDateOnly(java.util.Date date)
        Set time portion of passed date to 00:00:00
        Parameters:
        date -
        Returns:
        The same as the input date, but with time set to 00:00:00
      • stringToTime

        public java.util.Date stringToTime(java.lang.String s,
                                           java.util.Locale l,
                                           java.util.TimeZone tz)
                                    throws SKDAppletException
        Convert a time string to a date using the specified locale and time zone.
        Throws:
        SKDAppletException
      • dateTimeToDisplayString

        public java.lang.String dateTimeToDisplayString(java.util.Date d,
                                                        java.util.Locale l,
                                                        java.util.TimeZone tz)
        Convert a date to a datetime string using the specified locale and time zone.
      • dateTimeToDisplayString

        public java.lang.String dateTimeToDisplayString(java.util.Date d,
                                                        java.util.Locale l)
        Convert a date to a datetime string using the specified locale and time zone.
      • dateTimeToParseString

        public java.lang.String dateTimeToParseString(java.util.Date d,
                                                      java.util.Locale l,
                                                      java.util.TimeZone tz)
        Convert a date to a parse datetime string using the specified locale and time zone.
      • dateToString

        public java.lang.String dateToString(java.util.Date d,
                                             java.util.Locale l,
                                             java.util.TimeZone tz)
        Convert a date to a string using the specified locale and time zone.
      • timeToDisplayString

        public java.lang.String timeToDisplayString(java.util.Date d,
                                                    java.util.Locale l,
                                                    java.util.TimeZone tz)
        Convert a date to time string using the specified locale and time zone.
      • timeToParseString

        public java.lang.String timeToParseString(java.util.Date d,
                                                  java.util.Locale l,
                                                  java.util.TimeZone tz)
        Convert a date to time string using the specified locale and time zone.
      • stringToBoolean

        public boolean stringToBoolean(java.lang.String s,
                                       java.util.Locale l)
                                throws SKDAppletException
        Convert a string to a boolean value specific locale
        Throws:
        SKDAppletException
      • convertToStoreYNValue

        public java.lang.String convertToStoreYNValue(java.lang.String val,
                                                      java.util.Locale l)
                                               throws SKDAppletException
        Converts the YORN value to Store YORN value
        Throws:
        SKDAppletException
      • booleanToString

        public java.lang.String booleanToString(boolean b,
                                                java.util.Locale l)
        Converts a boolean value to a string value. Uses the Y/N character representations from locale file
      • doubleToDuration

        public java.lang.String doubleToDuration(double d)
        Convert a double value to a string using the specified locale.
      • durationToDouble

        public double durationToDouble(java.lang.String s,
                                       java.util.Locale l)
                                throws SKDAppletException
        Convert a duation string to a double value using the specified locale.
        Throws:
        SKDAppletException
      • stringToDouble

        public double stringToDouble(java.lang.String s,
                                     java.util.Locale l)
                              throws SKDAppletException
        convert a double to string using the specified locale
        Throws:
        SKDAppletException
      • getDatePattern

        public java.lang.String getDatePattern()
      • getTimePattern

        public java.lang.String getTimePattern()
      • dateTimeToString

        public java.lang.String dateTimeToString(java.util.Date d,
                                                 java.util.Locale l,
                                                 java.util.TimeZone tz)
      • doubleToString

        public java.lang.String doubleToString(double d,
                                               int places,
                                               java.util.Locale l,
                                               boolean groupingInFormat)
        Convert a double to a string, setting the number of decimal places using the specified locale.