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

java.lang.Object
  extended by javax.xml.datatype.XMLGregorianCalendar
      extended by org.eclipse.emf.ecore.xml.type.internal.XMLCalendar
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class XMLCalendar
extends javax.xml.datatype.XMLGregorianCalendar
implements java.io.Serializable

An internal extension of Java's XMLGregorianCalendar to represent W3C XML Schema 1.0 dateTime, time, date, gYearMonth, gYear, gMonthDay, gDay, gMonth data types.

NOTE: this class is for internal use only.

See Also:
Serialized Form

Field Summary
static short DATE
           
static short DATETIME
           
protected static java.text.DateFormat[] EDATE_FORMATS
           
static int EQUALS
           
static short GDAY
           
static short GMONTH
           
static short GMONTHDAY
           
static int GREATER_THAN
           
static short GYEAR
           
static short GYEARMONTH
           
static int INDETERMINATE
           
static int LESS_THAN
           
static short TIME
           
protected static java.lang.String[] XML_SCHEMA_TYPES
           
 
Constructor Summary
XMLCalendar(java.util.Date date, short dataType)
           
XMLCalendar(java.lang.String value, short datatype)
           
 
Method Summary
 void add(javax.xml.datatype.Duration duration)
           
 void clear()
           
 java.lang.Object clone()
           
static int compare(XMLCalendar value1, XMLCalendar value2)
           
 int compare(javax.xml.datatype.XMLGregorianCalendar xmlGregorianCalendar)
           
 boolean equals(java.lang.Object object)
           
 java.util.Date getDate()
           
 int getDay()
           
 java.math.BigInteger getEon()
           
 java.math.BigInteger getEonAndYear()
           
 java.math.BigDecimal getFractionalSecond()
           
 int getHour()
           
 int getMinute()
           
 int getMonth()
           
 int getSecond()
           
 int getTimezone()
           
 java.util.TimeZone getTimeZone(int defaultTimeZone)
           
 javax.xml.namespace.QName getXMLSchemaType()
           
 int getYear()
           
 int hashCode()
           
 boolean isValid()
           
 javax.xml.datatype.XMLGregorianCalendar normalize()
           
 void reset()
           
 void setDay(int day)
           
 void setFractionalSecond(java.math.BigDecimal fractionalSecond)
           
 void setHour(int hour)
           
 void setMillisecond(int millisecond)
           
 void setMinute(int minute)
           
 void setMonth(int month)
           
 void setSecond(int second)
           
 void setTimezone(int offset)
           
 void setYear(java.math.BigInteger year)
           
 void setYear(int year)
           
 java.util.GregorianCalendar toGregorianCalendar()
           
 java.util.GregorianCalendar toGregorianCalendar(java.util.TimeZone timeZone, java.util.Locale locale, javax.xml.datatype.XMLGregorianCalendar defaults)
           
 java.lang.String toString()
           
 java.lang.String toXMLFormat()
           
 
Methods inherited from class javax.xml.datatype.XMLGregorianCalendar
getMillisecond, setTime, setTime, setTime
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATETIME

public static final short DATETIME
See Also:
Constant Field Values

TIME

public static final short TIME
See Also:
Constant Field Values

DATE

public static final short DATE
See Also:
Constant Field Values

GYEARMONTH

public static final short GYEARMONTH
See Also:
Constant Field Values

GYEAR

public static final short GYEAR
See Also:
Constant Field Values

GMONTHDAY

public static final short GMONTHDAY
See Also:
Constant Field Values

GDAY

public static final short GDAY
See Also:
Constant Field Values

GMONTH

public static final short GMONTH
See Also:
Constant Field Values

XML_SCHEMA_TYPES

protected static final java.lang.String[] XML_SCHEMA_TYPES

EQUALS

public static final int EQUALS
See Also:
Constant Field Values

LESS_THAN

public static final int LESS_THAN
See Also:
Constant Field Values

GREATER_THAN

public static final int GREATER_THAN
See Also:
Constant Field Values

INDETERMINATE

public static final int INDETERMINATE
See Also:
Constant Field Values

EDATE_FORMATS

protected static final java.text.DateFormat[] EDATE_FORMATS
Constructor Detail

XMLCalendar

public XMLCalendar(java.lang.String value,
                   short datatype)

XMLCalendar

public XMLCalendar(java.util.Date date,
                   short dataType)
Method Detail

compare

public static int compare(XMLCalendar value1,
                          XMLCalendar value2)

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class javax.xml.datatype.XMLGregorianCalendar

hashCode

public int hashCode()
Overrides:
hashCode in class javax.xml.datatype.XMLGregorianCalendar

toString

public java.lang.String toString()
Overrides:
toString in class javax.xml.datatype.XMLGregorianCalendar

getDate

public java.util.Date getDate()

add

public void add(javax.xml.datatype.Duration duration)
Specified by:
add in class javax.xml.datatype.XMLGregorianCalendar

clear

public void clear()
Specified by:
clear in class javax.xml.datatype.XMLGregorianCalendar

clone

public java.lang.Object clone()
Specified by:
clone in class javax.xml.datatype.XMLGregorianCalendar

compare

public int compare(javax.xml.datatype.XMLGregorianCalendar xmlGregorianCalendar)
Specified by:
compare in class javax.xml.datatype.XMLGregorianCalendar

getDay

public int getDay()
Specified by:
getDay in class javax.xml.datatype.XMLGregorianCalendar

getEon

public java.math.BigInteger getEon()
Specified by:
getEon in class javax.xml.datatype.XMLGregorianCalendar

getEonAndYear

public java.math.BigInteger getEonAndYear()
Specified by:
getEonAndYear in class javax.xml.datatype.XMLGregorianCalendar

getFractionalSecond

public java.math.BigDecimal getFractionalSecond()
Specified by:
getFractionalSecond in class javax.xml.datatype.XMLGregorianCalendar

getHour

public int getHour()
Specified by:
getHour in class javax.xml.datatype.XMLGregorianCalendar

getMinute

public int getMinute()
Specified by:
getMinute in class javax.xml.datatype.XMLGregorianCalendar

getMonth

public int getMonth()
Specified by:
getMonth in class javax.xml.datatype.XMLGregorianCalendar

getSecond

public int getSecond()
Specified by:
getSecond in class javax.xml.datatype.XMLGregorianCalendar

getTimeZone

public java.util.TimeZone getTimeZone(int defaultTimeZone)
Specified by:
getTimeZone in class javax.xml.datatype.XMLGregorianCalendar

getTimezone

public int getTimezone()
Specified by:
getTimezone in class javax.xml.datatype.XMLGregorianCalendar

getXMLSchemaType

public javax.xml.namespace.QName getXMLSchemaType()
Specified by:
getXMLSchemaType in class javax.xml.datatype.XMLGregorianCalendar

getYear

public int getYear()
Specified by:
getYear in class javax.xml.datatype.XMLGregorianCalendar

isValid

public boolean isValid()
Specified by:
isValid in class javax.xml.datatype.XMLGregorianCalendar

normalize

public javax.xml.datatype.XMLGregorianCalendar normalize()
Specified by:
normalize in class javax.xml.datatype.XMLGregorianCalendar

reset

public void reset()
Specified by:
reset in class javax.xml.datatype.XMLGregorianCalendar

setDay

public void setDay(int day)
Specified by:
setDay in class javax.xml.datatype.XMLGregorianCalendar

setFractionalSecond

public void setFractionalSecond(java.math.BigDecimal fractionalSecond)
Specified by:
setFractionalSecond in class javax.xml.datatype.XMLGregorianCalendar

setHour

public void setHour(int hour)
Specified by:
setHour in class javax.xml.datatype.XMLGregorianCalendar

setMillisecond

public void setMillisecond(int millisecond)
Specified by:
setMillisecond in class javax.xml.datatype.XMLGregorianCalendar

setMinute

public void setMinute(int minute)
Specified by:
setMinute in class javax.xml.datatype.XMLGregorianCalendar

setMonth

public void setMonth(int month)
Specified by:
setMonth in class javax.xml.datatype.XMLGregorianCalendar

setSecond

public void setSecond(int second)
Specified by:
setSecond in class javax.xml.datatype.XMLGregorianCalendar

setTimezone

public void setTimezone(int offset)
Specified by:
setTimezone in class javax.xml.datatype.XMLGregorianCalendar

setYear

public void setYear(java.math.BigInteger year)
Specified by:
setYear in class javax.xml.datatype.XMLGregorianCalendar

setYear

public void setYear(int year)
Specified by:
setYear in class javax.xml.datatype.XMLGregorianCalendar

toGregorianCalendar

public java.util.GregorianCalendar toGregorianCalendar()
Specified by:
toGregorianCalendar in class javax.xml.datatype.XMLGregorianCalendar

toGregorianCalendar

public java.util.GregorianCalendar toGregorianCalendar(java.util.TimeZone timeZone,
                                                       java.util.Locale locale,
                                                       javax.xml.datatype.XMLGregorianCalendar defaults)
Specified by:
toGregorianCalendar in class javax.xml.datatype.XMLGregorianCalendar

toXMLFormat

public java.lang.String toXMLFormat()
Specified by:
toXMLFormat in class javax.xml.datatype.XMLGregorianCalendar

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