java.lang.Object
org.apache.jena.datatypes.xsd.AbstractDateTime
- All Implemented Interfaces:
Comparable<AbstractDateTime>
- Direct Known Subclasses:
XSDDateTime
,XSDDuration
Base class for representation of XSD duration, time, date/time
and related datatype instances. We are using the Xerces internal
packages for the all heavy lifting which represent date/times
using an int array. These wrapper classes just provide more
convenient access to the date values.
This class includes code derived from Xerces 2.6.0 Copyright (c) 1999-2002 The Apache Software Foundation. All rights reserved.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
constant to indicate an equals relationship from compare()static final short
constant to indicate a greater than relationship from compare()static final short
constant to indicate an indeterminate relationship from compare()static final short
constant to indicate a less than relationship from compare() -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(AbstractDateTime other) Comparison function.int
Normal java comparison function.boolean
Equality functionint
hashCode()
static void
normalize
(int[] date, int[] timeZone) If timezone present - normalize dateTime [E Adding durations to dateTimes] Public to allow reuse with type objects.
-
Field Details
-
LESS_THAN
public static final short LESS_THANconstant to indicate a less than relationship from compare()- See Also:
-
EQUAL
public static final short EQUALconstant to indicate an equals relationship from compare()- See Also:
-
GREATER_THAN
public static final short GREATER_THANconstant to indicate a greater than relationship from compare()- See Also:
-
INDETERMINATE
public static final short INDETERMINATEconstant to indicate an indeterminate relationship from compare()- See Also:
-
-
Constructor Details
-
AbstractDateTime
Constructor- Parameters:
value
- the date/time value returned by the parsing
-
-
Method Details
-
compare
Comparison function. Not quite the same as normal java compare because XSD date/times are not always comparable.- Parameters:
other
- the time/date to compare to- Returns:
- an order flag - one of LESS_THAN, EQUAL, GREATER_THEN, INDETERMINATE
-
compareTo
Normal java comparison function. Treats INDETERMINATE as the same as equals. This is not strictly correct but seems like an appropriate way to handle partially ordered objects.- Specified by:
compareTo
in interfaceComparable<AbstractDateTime>
-
equals
Equality function -
hashCode
public int hashCode() -
normalize
public static void normalize(int[] date, int[] timeZone) If timezone present - normalize dateTime [E Adding durations to dateTimes] Public to allow reuse with type objects.- Parameters:
date
- CCYY-MM-DDThh:mm:ss+03
-