org.eclipse.emf.ecore.xml.type.internal
Class XMLDuration
java.lang.Object
org.eclipse.emf.ecore.xml.type.internal.XMLDuration
- public final class XMLDuration
- extends Object
Representation for the W3C XML Schema 1.0
duration datatype.
NOTE: this class is for internal use only.
Later this class will be replaced by JAXP 1.3 javax.xml.datatype.Duration class.
This class is based on Apache Xerces2 2.6.2 parser implementation of date/time validation.
XMLDuration
public XMLDuration(String value)
equals
public boolean equals(Object obj)
hashCode
public int hashCode()
compare
public static int compare(XMLDuration value1,
XMLDuration value2)
compareDates
protected static short compareDates(int[] date1,
int[] date2,
boolean strict)
- Compares 2 given durations. (refer to W3C Schema Datatypes "3.2.6 duration")
- Parameters:
date1
- Unnormalized durationdate2
- Unnormalized durationstrict
- (min/max)Exclusive strict == true ( LESS_THAN ) or ( GREATER_THAN )
(min/max)Inclusive strict == false (LESS_EQUAL) or (GREATER_EQUAL)
- Returns:
- INDETERMINATE if the order relationship between date1 and date2 is indeterminate.
EQUAL if the order relation between date1 and date2 is EQUAL.
If the strict parameter is true, return LESS_THAN if date1 is less than date2 and
return GREATER_THAN if date1 is greater than date2.
If the strict parameter is false, return LESS_THAN if date1 is less than OR equal to date2 and
return GREATER_THAN if date1 is greater than OR equal to date2
toString
public String toString()