com.ibm.itim.common
Class AttributeDateValue

java.lang.Object
  |
  +--java.util.Date
        |
        +--com.ibm.itim.common.AttributeDateValue
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class AttributeDateValue
extends java.util.Date

Class for handling time in Generalized Time Format as specified by X.208. This time is of the format YYYYMMDDHHMMSSZ where Z is the time zone (using GMT is recomended by RFC 2252).

See Also:
Serialized Form

Constructor Summary
AttributeDateValue(java.util.Date date)
          Construct a AttributeDateValue with a Date.
AttributeDateValue(int year, int month, int day, int hour, int minute, int second)
          Construct a GeneralizedTime from a set of time arguments.
AttributeDateValue(long systemTime)
          Construct a AttributeDateValue with a Date.
AttributeDateValue(java.lang.String generalizedTimeString)
          This constructor is modified to use the method setGeneralizedTimeStringData() which is now private.
AttributeDateValue(java.lang.String generalizedTimeString, boolean ignoreSecond)
          This method constructs the date data including seconds
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides the method from java.lang.Object.
 java.lang.String getDD()
          Returns a String representing this AttributeDateValue's day of the month field.
 java.lang.String gethh()
          Returns a String representing the 2 digit hour of the day in this AttributeDateValue.
 java.lang.String getmm()
          Returns a String representing the 2 digit minutes of the hour in this AttributeDateValue.
 java.lang.String getMM()
          Returns a String representing this AttributeDateValue's month field.
 java.lang.String getYY()
          Returns a String representing the last 2 digits of this AttributeDateValue's year field.
 java.lang.String getYYYY()
          Returns a String representing this AttributeDateValue's 4 digit year.
 int hashCode()
          Overrides the method from java.lang.Object.
 java.lang.String toString()
          Overrides the method from java.lang.Object.
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDateValue

public AttributeDateValue(java.util.Date date)
Construct a AttributeDateValue with a Date.

Parameters:
date - Initial date for the AttributeDateValue.

AttributeDateValue

public AttributeDateValue(long systemTime)
Construct a AttributeDateValue with a Date.

Parameters:
systemTime - Initial date for the AttributeDateValue as system time in milliseconds.

AttributeDateValue

public AttributeDateValue(java.lang.String generalizedTimeString)
This constructor is modified to use the method setGeneralizedTimeStringData() which is now private.

Parameters:
generalizedTimeString - a GeneralizedTime String.

AttributeDateValue

public AttributeDateValue(java.lang.String generalizedTimeString,
                          boolean ignoreSecond)
This method constructs the date data including seconds

Parameters:
generalizedTimeString -
ignoreSecond - : false indicates the second data should be considered
Since:
4.6

AttributeDateValue

public AttributeDateValue(int year,
                          int month,
                          int day,
                          int hour,
                          int minute,
                          int second)
Construct a GeneralizedTime from a set of time arguments.

Parameters:
year - a 4 digit year (for example, 1979)
month - a 2 digit month (for example, 06 for July). Values range from 01 to 12.
day - a 2 digit day of the month (for example, 15). Values range from 01 to 31.
hour - a 2 digit hour of the day (for example, 12). Values range from 00 to 23.
minute - a 2 digit minute of the hour (for example 15). Values range from 00 to 59.
second - a 2 digit seconds of the minute (for example 20). Values range from 00 to 59.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides the method from java.lang.Object.

Overrides:
equals in class java.util.Date
Parameters:
obj - another GeneralizedTime object.
Returns:
true if the argument is also a GeneralizedTime object and has the same string representation

hashCode

public int hashCode()
Overrides the method from java.lang.Object.

Overrides:
hashCode in class java.util.Date
Returns:
the same hash code as the string representation of this class.

toString

public java.lang.String toString()
Overrides the method from java.lang.Object.

Overrides:
toString in class java.util.Date
Returns:
A string in the form YYYYmmddhhmmZ

getMM

public java.lang.String getMM()
Returns a String representing this AttributeDateValue's month field.

Returns:
A String for the month field. For example: "06" for June.

getDD

public java.lang.String getDD()
Returns a String representing this AttributeDateValue's day of the month field.

Returns:
A String for the day of month field. For example: "15" for the 15th.

getYY

public java.lang.String getYY()
Returns a String representing the last 2 digits of this AttributeDateValue's year field.

Returns:
A String for the year field. For example: "79".

getYYYY

public java.lang.String getYYYY()
Returns a String representing this AttributeDateValue's 4 digit year.

Returns:
A String for the 4 digit year. For example: "1979".

gethh

public java.lang.String gethh()
Returns a String representing the 2 digit hour of the day in this AttributeDateValue.

Returns:
A String for the 2 digit hour of the day. For example: "12" for noon.

getmm

public java.lang.String getmm()
Returns a String representing the 2 digit minutes of the hour in this AttributeDateValue.

Returns:
A String for the 2 digit minutes of the hour. For example: "15" for 15 minutes past the hour.


IBM Tivoli Identity Manager 4.6
© Copyright International Business Machines Corporation 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.