edu.cmu.aura.service.xml.xmlschema
Class TimeInstant

java.lang.Object
  |
  +--edu.cmu.aura.service.xml.xmlschema.TimeInstant

public class TimeInstant
extends java.lang.Object

TimeInstant is the XML Schema primitive type that represents an instant of time. // FIXME TIMEZONES IMPLEMENTED?


Constructor Summary
TimeInstant(long millis)
          Create a new TimeInstant from Java time in millis.
TimeInstant(java.lang.String def)
          Create a new TimeInstant from a serialized definition.
 
Method Summary
 long convertToMillis()
          Get the value of this instant in seconds.
 double convertToSeconds()
          Get the value of this instant in seconds.
 int getDay()
          Gets the day field of this instant.
 int getHour()
          Gets the hour field of this instant.
 int getMinute()
          Gets the minute field of this instant.
 int getMonth()
          Gets the month field of this instant.
 double getSecond()
          Gets the second field of this instant.
 int getYear()
          Gets the year field of this instant.
 java.lang.String toString()
          Serialize this TimeInstant in manner that conforms to the XMLSchema TimeInstant definition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeInstant

public TimeInstant(java.lang.String def)
            throws DataFormatException
Create a new TimeInstant from a serialized definition.
Parameters:
def - the time instant definition.

TimeInstant

public TimeInstant(long millis)
Create a new TimeInstant from Java time in millis.
Parameters:
millis - the time in millis
Method Detail

getSecond

public double getSecond()
Gets the second field of this instant.
Returns:
the second field of this instant.

getMinute

public int getMinute()
Gets the minute field of this instant.
Returns:
the minute field of this instant.

getHour

public int getHour()
Gets the hour field of this instant.
Returns:
the hour field of this instant.

getDay

public int getDay()
Gets the day field of this instant.
Returns:
the day field of this instant.

getMonth

public int getMonth()
Gets the month field of this instant.
Returns:
the month field of this instant.

getYear

public int getYear()
Gets the year field of this instant.
Returns:
the year field of this instant.

convertToSeconds

public double convertToSeconds()
Get the value of this instant in seconds.
Returns:
the length of this instant in seconds according to Java's reference date..

convertToMillis

public long convertToMillis()
Get the value of this instant in seconds.
Returns:
the length of this instant in seconds according to Java's reference date..

toString

public java.lang.String toString()
Serialize this TimeInstant in manner that conforms to the XMLSchema TimeInstant definition.
Overrides:
toString in class java.lang.Object
Returns:
a serialized version of this TimeInstant.