javax.cim

Class CIMDateTimeAbsolute

public class CIMDateTimeAbsolute extends CIMDateTime

This class represents the datetime data type when used as a time value as specified in the CIM Infrastructure specification. It is in the format yyyyMMddHHmmss.SSSSSSsutc where: For example Monday, May 25, 1998, at 1:30 PM EST would be represented as: 19980525133015.000000-300. Values must be zero-padded so that the entire string is always the same 25-character length. Fields which are not significant must be replaced with asterisk characters.
Constructor Summary
CIMDateTimeAbsolute()
Create a CIMDateTimeAbsolute object using the current Time/Date of the system.
CIMDateTimeAbsolute(Calendar pCalendar)
Create a CIMDateTimeAbsolute object using a Calendar object.
CIMDateTimeAbsolute(String pDateTime)
Creates a CIMDateTimeAbsolute object using a string.
Method Summary
intcompareTo(CIMDateTime pDateTime)
Compares the CIMDateTimeAbsolute object with this one.
intgetDay()
Returns day value of this date.
intgetHour()
Returns hour value of this date.
intgetMicrosecond()
Returns microsecond value of this date.
intgetMinute()
Returns minute value of this date.
intgetMonth()
Returns month value of this date.
intgetSecond()
Returns second value of this date.
intgetUTCOffset()
Returns UTC offset value of this date.
intgetYear()
Returns year value of this Date.

Constructor Detail

CIMDateTimeAbsolute

public CIMDateTimeAbsolute()
Create a CIMDateTimeAbsolute object using the current Time/Date of the system.

CIMDateTimeAbsolute

public CIMDateTimeAbsolute(Calendar pCalendar)
Create a CIMDateTimeAbsolute object using a Calendar object.

Parameters: pCalendar A Calendar object used to initialize this object.

Throws: IllegalArgumentException If Calendar object is null.

CIMDateTimeAbsolute

public CIMDateTimeAbsolute(String pDateTime)
Creates a CIMDateTimeAbsolute object using a string.

Parameters: pDateTime A string in the format of yyyyMMddHHmmss.SSSSSSsutc.

Throws: IllegalArgumentException If string is not in the correct format.

Method Detail

compareTo

public int compareTo(CIMDateTime pDateTime)
Compares the CIMDateTimeAbsolute object with this one. If either date has "Not Significant" fields then we can only compare the significant fields.

Parameters: pDateTime The CIMDateTimeAbsolute to be compared with this one.

Returns: -1, zero, or 1 as this date is less than, equal to, or greater than the specified date.

Throws: IllegalArgumentException If the object passed in is not an instance of CIMDataTimeAbsolute.

getDay

public int getDay()
Returns day value of this date.

Returns: If day field "not significant" this returns -1, otherwise returns day of this date.

getHour

public int getHour()
Returns hour value of this date.

Returns: If hour field "not significant" this returns -1, otherwise returns hour of this date.

getMicrosecond

public int getMicrosecond()
Returns microsecond value of this date.

Returns: If microsecond field "not significant" this returns -1, otherwise returns microseconds of this date.

getMinute

public int getMinute()
Returns minute value of this date.

Returns: If minute field "not significant" this returns -1, otherwise returns minute of this date.

getMonth

public int getMonth()
Returns month value of this date.

Returns: If month field "not significant" this returns -1, otherwise returns the month of this date.

getSecond

public int getSecond()
Returns second value of this date.

Returns: If second field "not significant" this returns -1, otherwise returns second of this date.

getUTCOffset

public int getUTCOffset()
Returns UTC offset value of this date.

Returns: UTC offset of this date.

getYear

public int getYear()
Returns year value of this Date.

Returns: If year field "not significant" this returns -1, otherwise returns the year of this date.

Copyright © 2005, 2010 IBM Corporation. All Rights Reserved.