Class CIMDateTime
java.lang.Object
org.sblim.wbem.cim.CIMDateTime
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
CIMSimpleDateTime, CIMTimeInterval
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
protected Calendar
protected String
protected int
protected int
protected boolean
protected int
protected int
protected int
protected int
protected int
protected int
protected int
protected int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CIMDateTime
(String pDateString) Deprecated.this constructor was marked as deprecated because the dual nature of this object.CIMDateTime
(Calendar pCalendar) Deprecated.this constructor was marked as deprecated because the dual nature of this object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
after
(CIMDateTime pThat) Determines if the current date time occurs after the date type from the specified object.boolean
before
(CIMDateTime pThat) Determines if the current date time ocurrs after the date type from the specified object.clone()
protected CIMDateTime
clone
(CIMDateTime pClone) boolean
Returns a calendar representation of this object.int
getDay()
Gets the number of days specified for this CIMDateTime.int
getHour()
Gets the number of hours specified for this CIMDateTime.int
Returns the number of precision digits defined for microseconds.int
Gets the number of microseconds specified for this CIMDateTime.int
Gets the number of milliseconds specified for this CIMDateTime.int
Gets the number of minutes specified for this CIMDateTime.int
Gets the number of offset minutes specified for this CIMDateTime.int
Gets the precision level of this CIMDateTime.int
Gets the number of seconds specified for this CIMDateTime.int
hashCode()
boolean
Determines if this CIMDateTime has day precision.boolean
Determines if this CIMDateTime has hour precision.boolean
Determines if the current object is represents an interval.boolean
Determines if this CIMDateTime has minute precision.boolean
Determines if this CIMDateTime has month precision.boolean
Determines if this CIMDateTime has minute precision.boolean
Determines if this CIMDateTime has year precision.static void
void
setHour
(int pHour) Specifies the number of hours for this CIMDateTime.void
setMicroseconds
(int pMicrosecond) Gets the number of microseconds specified this CIMDateTime.void
setMilliseconds
(int pMillisecond) Gets the number of milliseconds specified this CIMDateTime.void
setMinute
(int pMinute) Specifies the number of minutes for this CIMDateTime.void
setOffsetMinute
(int pOffsetMinutes) Sets the number of offset minutes associated with this CIMDateTime.void
setPrecision
(int pPrecision) Specifies the precision level for this CIMDateTime.void
setSecond
(int pSecond) Sets the number of seconds for this CIMDateTime.protected String
starPadding
(int pDigits) toMOF()
Returns the MOF representation of this object.toString()
static CIMDateTime
Creates an CIMDateTime object from the specified String argument.protected static CIMDateTime
valueOf
(CIMDateTime pDatetime, String pDateString) protected String
zeroPadding
(int pValue, int pDigits)
-
Field Details
-
iDateString
-
iCalendar
-
iInterval
protected boolean iInterval -
iYear
protected int iYear -
iMonth
protected int iMonth -
iDay
protected int iDay -
iHour
protected int iHour -
iMinute
protected int iMinute -
iSecond
protected int iSecond -
iMillisecond
protected int iMillisecond -
iMicrosecond
protected int iMicrosecond -
iOffsetMinute
protected int iOffsetMinute -
iPrecision
protected int iPrecision -
YEAR_PRECISION
public static final int YEAR_PRECISION- See Also:
-
MONTH_PRECISION
public static final int MONTH_PRECISION- See Also:
-
DAY_PRECISION
public static final int DAY_PRECISION- See Also:
-
HOUR_PRECISION
public static final int HOUR_PRECISION- See Also:
-
MINUTE_PRECISION
public static final int MINUTE_PRECISION- See Also:
-
SECOND_PRECISION
public static final int SECOND_PRECISION- See Also:
-
MILLI_ONE_DIGIT_PRECISION
public static final int MILLI_ONE_DIGIT_PRECISION- See Also:
-
MILLI_TWO_DIGIT_PRECISION
public static final int MILLI_TWO_DIGIT_PRECISION- See Also:
-
MILLI_THREE_DIGIT_PRECISION
public static final int MILLI_THREE_DIGIT_PRECISION- See Also:
-
MILLI_FOUR_DIGIT_PRECISION
public static final int MILLI_FOUR_DIGIT_PRECISION- See Also:
-
MILLI_FIVE_DIGIT_PRECISION
public static final int MILLI_FIVE_DIGIT_PRECISION- See Also:
-
MILLI_SIX_DIGIT_PRECISION
public static final int MILLI_SIX_DIGIT_PRECISION- See Also:
-
FULL_PRECISION
public static final int FULL_PRECISION- See Also:
-
-
Constructor Details
-
CIMDateTime
Deprecated.this constructor was marked as deprecated because the dual nature of this object. This object was used to represent point in time, as well as intervals. Instead of this constructor applications are encourage to use corresponding objects such as CIMDateTime, or CIMSimpleDateTime.Construct an object of a CIMDateTime given a calendar.- Parameters:
pCalendar
- The calendar
-
CIMDateTime
Deprecated.this constructor was marked as deprecated because the dual nature of this object. This object was used to represent point in time, as well as intervals. Instead of this constructor applications are encourage to use corresponding objects such as CIMTimeInterval, or CIMSimpleDateTime.Creates an object of a CIMDateTime.- Parameters:
pDateString
- A string representation of a datetime
-
CIMDateTime
protected CIMDateTime()
-
-
Method Details
-
clone
-
clone
-
valueOf
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.- Parameters:
pDateString
- The date string to parse- Returns:
- a CIMDateTime or CIMSimpleDateTime object
-
valueOf
-
hashCode
-
after
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.- Parameters:
pThat
- The datetime to compare with- Returns:
true
ifthis
occurs afterpThat
,false
otherwise
-
before
Determines if the current date time ocurrs after the date type from the specified object.- Parameters:
pThat
- The datetime to compare with- Returns:
true
ifthis
occurs beforepThat
,false
otherwise
-
equals
-
isInterval
public boolean isInterval()Determines if the current object is represents an interval.- Returns:
- returns true if the datetime is an interval, otherwise returns false.
-
getCalendar
Returns a calendar representation of this object. If the object represent an interval, this method returns null.- Returns:
- The calendar representation
-
toMOF
Returns the MOF representation of this object.- Returns:
- The MOF representation
-
starPadding
-
zeroPadding
-
toString
-
getMillisecond
public int getMillisecond()Gets the number of milliseconds specified for this CIMDateTime.- Returns:
- The milliseconds
-
getMicrosecond
public int getMicrosecond()Gets the number of microseconds specified for this CIMDateTime.- Returns:
- The microsenconds
-
getMinute
public int getMinute()Gets the number of minutes specified for this CIMDateTime.- Returns:
- The minutes
-
getDay
public int getDay()Gets the number of days specified for this CIMDateTime.- Returns:
- The day
-
getHour
public int getHour()Gets the number of hours specified for this CIMDateTime.- Returns:
- The hours
-
getOffsetMinute
public int getOffsetMinute()Gets the number of offset minutes specified for this CIMDateTime.- Returns:
- The offset minutes
-
getSeconds
public int getSeconds()Gets the number of seconds specified for this CIMDateTime.- Returns:
- The seconds
-
setHour
public void setHour(int pHour) Specifies the number of hours for this CIMDateTime.- Parameters:
pHour
- The hour
-
setMilliseconds
public void setMilliseconds(int pMillisecond) Gets the number of milliseconds specified this CIMDateTime.- Parameters:
pMillisecond
- The milliseconds
-
setMicroseconds
public void setMicroseconds(int pMicrosecond) Gets the number of microseconds specified this CIMDateTime.- Parameters:
pMicrosecond
- The microsenconds
-
setMinute
public void setMinute(int pMinute) Specifies the number of minutes for this CIMDateTime.- Parameters:
pMinute
- The minutes
-
setOffsetMinute
public void setOffsetMinute(int pOffsetMinutes) Sets the number of offset minutes associated with this CIMDateTime.- Parameters:
pOffsetMinutes
- an integer value which species the number of offset minutes.- Throws:
IllegalArgumentException
- if the number of minutes is out of a valid range (-999,999)
-
setSecond
public void setSecond(int pSecond) Sets the number of seconds for this CIMDateTime.- Parameters:
pSecond
- integer value which species the number of seconds.- Throws:
IllegalArgumentException
- if the number of seconds is out of a valid range.
-
isDayPrecision
public boolean isDayPrecision()Determines if this CIMDateTime has day precision.- Returns:
- true if this CIMDateTime has day precision, otherwise returns false.
-
isHourPrecision
public boolean isHourPrecision()Determines if this CIMDateTime has hour precision.- Returns:
- true if this CIMDateTime has hour precision, otherwise returns false.
-
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.- Returns:
- an integer representing the number of precision digits for the milliseconds.
-
isMinutePrecision
public boolean isMinutePrecision()Determines if this CIMDateTime has minute precision.- Returns:
- true if this CIMDateTime has month precision, otherwise returns false.
-
isMonthPrecision
public boolean isMonthPrecision()Determines if this CIMDateTime has month precision.- Returns:
- true if this CIMDateTime has month precision, otherwise returns false.
-
isSecondPrecision
public boolean isSecondPrecision()Determines if this CIMDateTime has minute precision.- Returns:
- true if this CIMDateTime has month precision, otherwise returns false.
-
isYearPrecision
public boolean isYearPrecision()Determines if this CIMDateTime has year precision.- Returns:
- true if this CIMDateTime has year precision, otherwise returns false.
-
setPrecision
public void setPrecision(int pPrecision) Specifies the precision level for this CIMDateTime. The default value for this object is FULL_PRECISION.- Parameters:
pPrecision
- specifies the precision level for this object.
-
getPrecision
public int getPrecision()Gets the precision level of this CIMDateTime.- Returns:
- an integer value representing the precision level for this object.
-
main
-