org.inria.ns.reflex.processor.asl.types.xs
Class CalendarData

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.types.TypedData.Impl
      extended by org.inria.ns.reflex.processor.asl.types.xs.CalendarData
All Implemented Interfaces:
TypedData, Ignorable, IgnorableData, Unwrappable, XOperable

public class CalendarData
extends TypedData.Impl

The typed data for dates, times, and durations.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.processor.asl.types.TypedData
TypedData.DefaultTypedData, TypedData.Impl
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.structures.Unwrappable
Unwrappable.Unwrapper
 
Field Summary
 
Fields inherited from interface org.inria.ns.reflex.processor.asl.types.TypedData
TYPE_XOP
 
Fields inherited from interface org.inria.ns.reflex.structures.Unwrappable
UNWRAPPER
 
Constructor Summary
CalendarData(Type type, boolean beforeCommonEra, Number year, Byte month, Byte day, Byte hour, Byte mn, Byte sec, Number fracs, char timeZone, Byte tzhour, Byte tzmn, String lexicalValue, String remainder)
          Construct a new calendar.
CalendarData(Type type, boolean beforeCommonEra, Number year, Byte month, Byte day, char timeZone, Byte tzhour, Byte tzmn, String lexicalValue, String remainder)
          Construct a new calendar.
CalendarData(Type type, Byte hour, Byte mn, Byte sec, Number fracs, String lexicalValue, String remainder)
          Construct a new calendar.
 
Method Summary
 String getCanonicalValue()
          Return the canonical value of the underlying number.
 Number getDay()
           
 Number getFractionalSecond()
           
 Number getHour()
           
 String getLexicalValue()
          Return the lexical value of the underlying number.
 Number getMinute()
           
 Number getMonth()
           
 String getRemainder()
          Get the remainder after building this data.
 Number getSecond()
           
 char getTimeZone()
           
 Byte getTimeZoneHour()
           
 Byte getTimeZoneMinute()
           
 Type getType()
          Get the type of the data.
 Number getYear()
           
 boolean isBeforeCommonEra()
           
 void setBeforeCommonEra(boolean beforeCommonEra)
           
 void setDay(Number day)
           
 void setFractionalSecond(Number fracs)
           
 void setHour(Number hour)
           
 void setMinute(Number mn)
           
 void setMonth(Number month)
           
 void setSecond(Number sec)
           
 void setTimeZone(char timeZone)
           
 void setTimeZoneHour(Byte tzhour)
           
 void setTimeZoneMinute(Byte tzmn)
           
 void setValue(Object value)
          Set the value of this data.
 void setYear(Number year)
           
static CalendarData toCalendar(Object o)
          Get a calendar from an object.
 GregorianCalendar toGregorianCalendar()
          Return a gregorian calendar form of this date-time.
 String toString()
          Return the string value of the underlying number.
 Object unwrap()
          Get the data.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.types.TypedData.Impl
getNonIgnorableRemainder, getXOperator, ignore, isIgnorable, setIgnorable, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalendarData

public CalendarData(Type type,
                    boolean beforeCommonEra,
                    Number year,
                    Byte month,
                    Byte day,
                    Byte hour,
                    Byte mn,
                    Byte sec,
                    Number fracs,
                    char timeZone,
                    Byte tzhour,
                    Byte tzmn,
                    String lexicalValue,
                    String remainder)
Construct a new calendar.

Parameters:
type - A numeric type.
beforeCommonEra - Significative if year is not null.
year - Can be null if hour is not.
month -
day -
hour - Can be null if year is not.
mn -
sec -
fracs - Can be null
timeZone - 'Z', '+', '-', or (char)-1
tzhour - If timeZone is '+' or '-', else null
tzmn - If timeZone is '+' or '-', else null
lexicalValue - The lexical value of the number.
remainder - The remainder after parsing.

CalendarData

public CalendarData(Type type,
                    boolean beforeCommonEra,
                    Number year,
                    Byte month,
                    Byte day,
                    char timeZone,
                    Byte tzhour,
                    Byte tzmn,
                    String lexicalValue,
                    String remainder)
Construct a new calendar.

Parameters:
type - A numeric type.
beforeCommonEra - Significative if year is not null.
year - Can be null if hour is not.
month -
day -
fracs - Can be null
timeZone - 'Z', '+', '-', or (char)-1
tzhour - If timeZone is '+' or '-', else null
tzmn - If timeZone is '+' or '-', else null
lexicalValue - The lexical value of the number.
remainder - The remainder after parsing.

CalendarData

public CalendarData(Type type,
                    Byte hour,
                    Byte mn,
                    Byte sec,
                    Number fracs,
                    String lexicalValue,
                    String remainder)
Construct a new calendar.

Parameters:
type - A numeric type.
hour - Can be null if year is not.
mn -
sec -
fracs - Can be null
lexicalValue - The lexical value of the number.
remainder - The remainder after parsing.
Method Detail

isBeforeCommonEra

public boolean isBeforeCommonEra()

setBeforeCommonEra

public void setBeforeCommonEra(boolean beforeCommonEra)

getYear

public Number getYear()

setYear

public void setYear(Number year)

getMonth

public Number getMonth()

setMonth

public void setMonth(Number month)

getDay

public Number getDay()

setDay

public void setDay(Number day)

getHour

public Number getHour()

setHour

public void setHour(Number hour)

getMinute

public Number getMinute()

setMinute

public void setMinute(Number mn)

getSecond

public Number getSecond()

setSecond

public void setSecond(Number sec)

getFractionalSecond

public Number getFractionalSecond()

setFractionalSecond

public void setFractionalSecond(Number fracs)

getTimeZone

public char getTimeZone()

setTimeZone

public void setTimeZone(char timeZone)

getTimeZoneHour

public Byte getTimeZoneHour()

setTimeZoneHour

public void setTimeZoneHour(Byte tzhour)

getTimeZoneMinute

public Byte getTimeZoneMinute()

setTimeZoneMinute

public void setTimeZoneMinute(Byte tzmn)

setValue

public void setValue(Object value)
              throws TypeFormatException
Set the value of this data.

Parameters:
value - The value to set.
Throws:
TypeFormatException - When the value is not of the type expected.
See Also:
TypedData.setValue(java.lang.Object)

unwrap

public Object unwrap()
Get the data.

Returns:
The data.

getRemainder

public String getRemainder()
Get the remainder after building this data.

Returns:
The not null remainder.

getType

public Type getType()
Get the type of the data.

Returns:
The type of the data.

getCanonicalValue

public String getCanonicalValue()
Return the canonical value of the underlying number.

Returns:
The canonical value of the underlying number.

getLexicalValue

public String getLexicalValue()
Return the lexical value of the underlying number.

Returns:
The lexical value of the underlying number.

toString

public String toString()
Return the string value of the underlying number.

Overrides:
toString in class TypedData.Impl
Returns:
The string value of the underlying number.
See Also:
Object.toString()

toCalendar

public static CalendarData toCalendar(Object o)
                               throws TypeFormatException
Get a calendar from an object.

Parameters:
o - An object to consider as a calendar.
Returns:
A calendar.
Throws:
TypeFormatException - If the object was not castable or transformable to a calendar.

toGregorianCalendar

public GregorianCalendar toGregorianCalendar()
Return a gregorian calendar form of this date-time.

Returns:
A gregorian calendar.