org.eclipse.emf.ecore.xml.type.internal
Class XMLDuration

java.lang.Object
  extended byorg.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.


Constructor Summary
XMLDuration(String value)
           
 
Method Summary
static int compare(XMLDuration value1, XMLDuration value2)
           
protected static short compareDates(int[] date1, int[] date2, boolean strict)
          Compares 2 given durations.
 boolean equals(Object obj)
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLDuration

public XMLDuration(String value)
Method Detail

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 duration
date2 - Unnormalized duration
strict - (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()

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.