org.deri.iris.terms.concrete
Class DateTime

java.lang.Object
  extended by org.deri.iris.terms.concrete.DateTime
All Implemented Interfaces:
Comparable<ITerm>, IDateTime, IConcreteTerm, ITerm
Direct Known Subclasses:
DateTimeStamp

public class DateTime
extends Object
implements IDateTime

Simple implementation of the IDateTime.


Field Summary
static int MAX_TIMEZONE_HOURS
           
static int MAX_TIMEZONE_MINUTES
           
 
Method Summary
static void checkTimeZone(int tzHour, int tzMinute)
          Implements the restrictions as detailed in: http://www.w3.org/TR/xmlschema-2/#dateTime ( |h| < 14 AND |m| <= 59 ) OR ( |h| = 14, m = 0 ) AND sign( h ) = sign( m )
 int compareTo(ITerm o)
           
 boolean equals(Object obj)
           
 URI getDatatypeIRI()
          Returns the fully qualified identifier for the data type corresponding to this term.
 int getDay()
          Returns the day of the month.
 double getDecimalSecond()
          Return the complete floating point representation of the seconds components.
 int getHour()
          Returns the hour of the day.
 int getMillisecond()
          Returns the milliseconds of the second.
 int getMinute()
          Returns the minute of the hour
 int getMonth()
          Returns the month of the year.
 int getSecond()
          Returns the seconds of the minute.
 TimeZone getTimeZone()
          Returns the Timezone
 XMLGregorianCalendar getValue()
          Return the wrapped type.
 int getYear()
          Returns the year.
 int hashCode()
           
 boolean isGround()
          Checks whether the term is ground (a term with no variables).
 String toCanonicalString()
          Returns a canonical string representation of this term.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_TIMEZONE_HOURS

public static final int MAX_TIMEZONE_HOURS
See Also:
Constant Field Values

MAX_TIMEZONE_MINUTES

public static final int MAX_TIMEZONE_MINUTES
See Also:
Constant Field Values
Method Detail

checkTimeZone

public static void checkTimeZone(int tzHour,
                                 int tzMinute)
Implements the restrictions as detailed in: http://www.w3.org/TR/xmlschema-2/#dateTime ( |h| < 14 AND |m| <= 59 ) OR ( |h| = 14, m = 0 ) AND sign( h ) = sign( m )

Parameters:
tzHour - The time zone hours
tzMinute - The time zone minutes

compareTo

public int compareTo(ITerm o)
Specified by:
compareTo in interface Comparable<ITerm>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getDay

public int getDay()
Description copied from interface: IDateTime
Returns the day of the month.

Specified by:
getDay in interface IDateTime
Returns:
the day

getHour

public int getHour()
Description copied from interface: IDateTime
Returns the hour of the day.

Specified by:
getHour in interface IDateTime
Returns:
the hours (zero-based)

getMinute

public int getMinute()
Description copied from interface: IDateTime
Returns the minute of the hour

Specified by:
getMinute in interface IDateTime
Returns:
the minutes

getMonth

public int getMonth()
Description copied from interface: IDateTime
Returns the month of the year.

Specified by:
getMonth in interface IDateTime
Returns:
the month (zero-based)

getSecond

public int getSecond()
Description copied from interface: IDateTime
Returns the seconds of the minute.

Specified by:
getSecond in interface IDateTime
Returns:
the seconds

getMillisecond

public int getMillisecond()
Description copied from interface: IDateTime
Returns the milliseconds of the second.

Specified by:
getMillisecond in interface IDateTime
Returns:
the milliseconds

getDecimalSecond

public double getDecimalSecond()
Description copied from interface: IDateTime
Return the complete floating point representation of the seconds components.

Specified by:
getDecimalSecond in interface IDateTime
Returns:
Decimal seconds

getTimeZone

public TimeZone getTimeZone()
Description copied from interface: IDateTime
Returns the Timezone

Specified by:
getTimeZone in interface IDateTime
Returns:
the timezone

getYear

public int getYear()
Description copied from interface: IDateTime
Returns the year.

Specified by:
getYear in interface IDateTime
Returns:
the year

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isGround

public boolean isGround()
Description copied from interface: ITerm
Checks whether the term is ground (a term with no variables).

Specified by:
isGround in interface ITerm
Returns:
true if the term is ground, otherwise false.

getValue

public XMLGregorianCalendar getValue()
Description copied from interface: IDateTime
Return the wrapped type.

Specified by:
getValue in interface IDateTime
Specified by:
getValue in interface ITerm
Returns:
The term value.

getDatatypeIRI

public URI getDatatypeIRI()
Description copied from interface: IConcreteTerm
Returns the fully qualified identifier for the data type corresponding to this term. For instance, a terms representing a double data type should return the URI "http://www.w3.org/2001/XMLSchema#double".

Specified by:
getDatatypeIRI in interface IConcreteTerm
Returns:
The fully qualified identifier for the data type corresponding to this term.

toCanonicalString

public String toCanonicalString()
Description copied from interface: IConcreteTerm
Returns a canonical string representation of this term.

Specified by:
toCanonicalString in interface IConcreteTerm
Returns:
A canonical string representation of this term.