javax.cim
public class CIMDateTimeInterval extends CIMDateTime
CIMDateTimeInterval
class is modeled on the datetime data
type as specified in the CIM specification.Constructor and Description |
---|
CIMDateTimeInterval(int pDays,
int pHours,
int pMinutes,
int pSeconds,
int pMicroseconds)
Constructs a
CIMDateTimeInterval using the individual values
of the interval (day, hours, minutes, seconds and microseconds). |
CIMDateTimeInterval(long pMilliseconds)
Constructs a
CIMDateTimeInterval using a milliseconds value. |
CIMDateTimeInterval(String pIntervalString)
Creates a
CIMDateTimeInterval object using a string. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CIMDateTime o)
Compares the
CIMDateTimeInterval object with this one. |
String |
getDateTimeString()
Gets the internal string representation of this object.
|
int |
getDays()
Returns days value of this interval.
|
int |
getHours()
Returns hours value of this interval.
|
int |
getMicroseconds()
Returns microseconds value of this interval.
|
int |
getMinutes()
Returns minutes value of this interval.
|
int |
getSeconds()
Returns seconds value of this interval.
|
long |
getTotalMilliseconds()
Returns the total length of the interval in milliseconds.
|
int |
hashCode()
Returns the hashcode for this object.
|
String |
toString()
Returns a
String representation of the
CIMDateTimeInterval . |
equals
public CIMDateTimeInterval(int pDays, int pHours, int pMinutes, int pSeconds, int pMicroseconds) throws IllegalArgumentException
CIMDateTimeInterval
using the individual values
of the interval (day, hours, minutes, seconds and microseconds). Any
property that has a -1 will consider that field "not significant" (i.e.
that field has asterisks in the DateTime string).pDays
- - number of days in the interval (-1 - 99999999)pHours
- - number of hours in the interval (-1 - 24)pMinutes
- - number of minutes in the interval (-1 - 60)pSeconds
- - number of seconds in the interval (-1 - 60)pMicroseconds
- - number of microseconds in the interval (-1 - 999999)IllegalArgumentException
public CIMDateTimeInterval(long pMilliseconds) throws IllegalArgumentException
CIMDateTimeInterval
using a milliseconds value.pMilliseconds
- - number of milliseconds in the interval (0 - 999999)IllegalArgumentException
public CIMDateTimeInterval(String pIntervalString) throws IllegalArgumentException
CIMDateTimeInterval
object using a string.pIntervalString
- - A string in the format of ddddddddHHMMSS.mmmmmm:000IllegalArgumentException
- - if string is not in the correct formatpublic int compareTo(CIMDateTime o) throws IllegalArgumentException
CIMDateTimeInterval
object with this one. If
either interval has "Not Significant" fields then we only compare the
significant fields.o
- - The CIMDateTimeInterval to be compared with
this one.IllegalArgumentException
- - If the object passed in is not an instance of
CIMDataTimeInterval
.public String getDateTimeString()
getDateTimeString
in class CIMDateTime
CIMDateTimeInterval
object.CIMDateTime.getDateTimeString()
public int getDays()
public int getHours()
public int getMicroseconds()
public int getMinutes()
public int getSeconds()
public long getTotalMilliseconds()
public int hashCode()
hashCode
in class CIMDateTime
Object.hashCode()
public String toString()
String
representation of the
CIMDateTimeInterval
. This method is intended to be used only
for debugging purposes, and the format of the returned string may vary
between implementations. The returned string may be empty but may not be
null
.toString
in class Object
Object.toString()
Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.