jsdai.lang
Class SdaiCalendar

java.lang.Object
  extended byjava.util.Calendar
      extended byjava.util.GregorianCalendar
          extended byjsdai.lang.SdaiCalendar
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class SdaiCalendar
extends java.util.GregorianCalendar

This class gives methods to convert time values from long to String representation and vice versa. The format of the time description by string is specified in ISO 8601.

See Also:
"ISO 10303-21::9.2.2 file_name", Serialized Form

Field Summary
 
Fields inherited from class java.util.GregorianCalendar
AD, BC
 
Fields inherited from class java.util.Calendar
AM, AM_PM, APRIL, AUGUST, DAY_OF_YEAR, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DATE, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, FRIDAY, HOUR, HOUR_OF_DAY, YEAR, JANUARY, JULY, JUNE, MAY, MARCH, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_YEAR, WEEK_OF_MONTH, ZONE_OFFSET
 
Constructor Summary
SdaiCalendar()
          Creates a new SdaiCalendar.
 
Method Summary
 java.lang.String longToTimeStamp(long time)
          Converts the time value from long to String representation.
 long timeStampToLong(java.lang.String time_stamp)
          Converts the time value specified by String to long equivalent.
 
Methods inherited from class java.util.GregorianCalendar
add, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear, roll, roll, setGregorianChange
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, clone, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SdaiCalendar

public SdaiCalendar()
Creates a new SdaiCalendar.

Method Detail

timeStampToLong

public long timeStampToLong(java.lang.String time_stamp)
Converts the time value specified by String to long equivalent. The format of the description by string is specified in ISO 8601 (for details, see ISO 10303-21::9.2.2 file_name).

Example:

    SdaiCalendar cal = ...;
    String time = "2000-06-25T06:04:02";
    long time_as_long = cal.timeStampToLong(time);
    System.out.println("Time: " + time_as_long);
    The following line will be printed:
    Time: 961909442000

Parameters:
time_stamp - the time value written as string according to rules specified in ISO 8601.
Returns:
time as long variable.
See Also:
longToTimeStamp(long), "ISO 10303-21::9.2.2 file_name."

longToTimeStamp

public java.lang.String longToTimeStamp(long time)
Converts the time value from long to String representation. The format of the time description by string is specified in ISO 8601 (for details, see ISO 10303-21::9.2.2 file_name).

Example:

    SdaiCalendar cal = ...;
    long time_as_long = 961909442886;
    String time = cal.longToTimeStamp(time_as_long);
    System.out.println("Time: " + time);
    The following line will be printed:
    Time: 2000-06-25T06:04:02

Parameters:
time - the time as long number.
Returns:
the time value written as string according to rules specified in ISO 8601.
See Also:
timeStampToLong(java.lang.String), "ISO 10303-21::9.2.2 file_name."

Copyright © LKSoftWare GmbH, 1999-2008