CIMDateTime.java
(C) Copyright IBM Corp. 2005, 2009
THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
You can obtain a current copy of the Eclipse Public License from
http://www.opensource.org/licenses/eclipse-1.0.php
DAY_PRECISION
public static final int DAY_PRECISION
FULL_PRECISION
public static final int FULL_PRECISION
HOUR_PRECISION
public static final int HOUR_PRECISION
MILLI_FIVE_DIGIT_PRECISION
public static final int MILLI_FIVE_DIGIT_PRECISION
MILLI_FOUR_DIGIT_PRECISION
public static final int MILLI_FOUR_DIGIT_PRECISION
MILLI_ONE_DIGIT_PRECISION
public static final int MILLI_ONE_DIGIT_PRECISION
MILLI_SIX_DIGIT_PRECISION
public static final int MILLI_SIX_DIGIT_PRECISION
MILLI_THREE_DIGIT_PRECISION
public static final int MILLI_THREE_DIGIT_PRECISION
MILLI_TWO_DIGIT_PRECISION
public static final int MILLI_TWO_DIGIT_PRECISION
MINUTE_PRECISION
public static final int MINUTE_PRECISION
MONTH_PRECISION
public static final int MONTH_PRECISION
SECOND_PRECISION
public static final int SECOND_PRECISION
YEAR_PRECISION
public static final int YEAR_PRECISION
iCalendar
protected Calendar iCalendar
iDateString
protected String iDateString
iInterval
protected boolean iInterval
iMicrosecond
protected int iMicrosecond
iMillisecond
protected int iMillisecond
iMinute
protected int iMinute
iMonth
protected int iMonth
iOffsetMinute
protected int iOffsetMinute
iPrecision
protected int iPrecision
iSecond
protected int iSecond
after
public boolean after(CIMDateTime pThat)
Determines if the current date time occurs after the date type from the
specified object. Comparison of CIMSimpleDateTime and CIMIntervalTime are
meaningless, for this reason always return false.
pThat
- The datetime to compare with
true
if this
occurs after
pThat
, false
otherwise
before
public boolean before(CIMDateTime pThat)
Determines if the current date time ocurrs after the date type from the
specified object.
pThat
- The datetime to compare with
true
if this
occurs before
pThat
, false
otherwise
clone
public Object clone()
equals
public boolean equals(Object o)
getCalendar
public Calendar getCalendar()
Returns a calendar representation of this object. If the object represent
an interval, this method returns null.
- The calendar representation
getDay
public int getDay()
Gets the number of days specified for this CIMDateTime.
getHour
public int getHour()
Gets the number of hours specified for this CIMDateTime.
getMicrosecodsPrecision
public int getMicrosecodsPrecision()
Returns the number of precision digits defined for microseconds. For
instance, "19981207102059.10****-000" has 2 digits of precision.
"19981207102059.1*****-000" has 1 digit of precision, and
"199812071020**.******-000" has 0 digits of precision.
- an integer representing the number of precision digits for the
milliseconds.
getMicrosecond
public int getMicrosecond()
Gets the number of microseconds specified for this CIMDateTime.
getMillisecond
public int getMillisecond()
Gets the number of milliseconds specified for this CIMDateTime.
getMinute
public int getMinute()
Gets the number of minutes specified for this CIMDateTime.
getOffsetMinute
public int getOffsetMinute()
Gets the number of offset minutes specified for this CIMDateTime.
getPrecision
public int getPrecision()
Gets the precision level of this CIMDateTime.
- an integer value representing the precision level for this
object.
getSeconds
public int getSeconds()
Gets the number of seconds specified for this CIMDateTime.
hashCode
public int hashCode()
isDayPrecision
public boolean isDayPrecision()
Determines if this CIMDateTime has day precision.
- true if this CIMDateTime has day precision, otherwise returns
false.
isHourPrecision
public boolean isHourPrecision()
Determines if this CIMDateTime has hour precision.
- true if this CIMDateTime has hour precision, otherwise returns
false.
isInterval
public boolean isInterval()
Determines if the current object is represents an interval.
- returns true if the datetime is an interval, otherwise returns
false.
isMinutePrecision
public boolean isMinutePrecision()
Determines if this CIMDateTime has minute precision.
- true if this CIMDateTime has month precision, otherwise returns
false.
isMonthPrecision
public boolean isMonthPrecision()
Determines if this CIMDateTime has month precision.
- true if this CIMDateTime has month precision, otherwise returns
false.
isSecondPrecision
public boolean isSecondPrecision()
Determines if this CIMDateTime has minute precision.
- true if this CIMDateTime has month precision, otherwise returns
false.
isYearPrecision
public boolean isYearPrecision()
Determines if this CIMDateTime has year precision.
- true if this CIMDateTime has year precision, otherwise returns
false.
main
public static void main(String[] args)
setHour
public void setHour(int pHour)
Specifies the number of hours for this CIMDateTime.
setMicroseconds
public void setMicroseconds(int pMicrosecond)
Gets the number of microseconds specified this CIMDateTime.
pMicrosecond
- The microsenconds
setMilliseconds
public void setMilliseconds(int pMillisecond)
Gets the number of milliseconds specified this CIMDateTime.
pMillisecond
- The milliseconds
setMinute
public void setMinute(int pMinute)
Specifies the number of minutes for this CIMDateTime.
setOffsetMinute
public void setOffsetMinute(int pOffsetMinutes)
Sets the number of offset minutes associated with this CIMDateTime.
pOffsetMinutes
- an integer value which species the number of offset minutes.
setPrecision
public void setPrecision(int pPrecision)
Specifies the precision level for this CIMDateTime. The default value for
this object is FULL_PRECISION.
pPrecision
- specifies the precision level for this object.
setSecond
public void setSecond(int pSecond)
Sets the number of seconds for this CIMDateTime.
pSecond
- integer value which species the number of seconds.
starPadding
protected String starPadding(int pDigits)
toMOF
public String toMOF()
Returns the MOF representation of this object.
toString
public String toString()
valueOf
public static CIMDateTime valueOf(String pDateString)
Creates an CIMDateTime object from the specified String argument. This
method returns a CIMSimpleDateTime or a CIMDateTime, depending on what
type of CIMDataType is denoted by the string argument.
pDateString
- The date string to parse
- a CIMDateTime or CIMSimpleDateTime object
zeroPadding
protected String zeroPadding(int pValue,
int pDigits)