Class BigDateTimeValueType
- java.lang.Object
-
- com.sun.msv.datatype.xsd.datetime.BigDateTimeValueType
-
- All Implemented Interfaces:
IDateTimeValueType
,java.io.Serializable
public class BigDateTimeValueType extends java.lang.Object implements IDateTimeValueType
DateTimeValueType object that can hold all lexically valid dateTime value. This class provides:- Unlimited digits for year (e.g., "year 9999999999999999999999")
- Unlimited digits for fraction of second (e.g. 0.00000000000001 sec)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Integer
day
day (always normalized, between 0-30) this variable is null if no year is specifiedprivate java.lang.Integer
hour
hour (always between 0 and 23) this variable is null if no year is specifiedprivate java.lang.Integer
minute
minute (always between 0 and 59) this variable is null if no year is specifiedprivate java.lang.Integer
month
month (always between 0 and 11) this variable is null if no year is specifiedprivate IDateTimeValueType
normalizedValue
normalized DateTimeValue of this object.private java.math.BigDecimal
second
second (always in [0,60) ) this variable is null if no year is specifiedprivate static long
serialVersionUID
private java.math.BigInteger
year
year value.private java.util.TimeZone
zone
time zone specifier.
-
Constructor Summary
Constructors Constructor Description BigDateTimeValueType()
BigDateTimeValueType(BigDateTimeValueType base, java.util.TimeZone newTimeZone)
creates an instance with the specified BigDateTimeValueType, with modified time zone.BigDateTimeValueType(java.math.BigInteger year, int month, int day, int hour, int minute, java.math.BigDecimal second, java.util.TimeZone timeZone)
BigDateTimeValueType(java.math.BigInteger year, java.lang.Integer month, java.lang.Integer day, java.lang.Integer hour, java.lang.Integer minute, java.math.BigDecimal second, java.util.TimeZone timeZone)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IDateTimeValueType
add(ITimeDurationValueType _rhs)
returns the result of addition of this object and TimeDuration.protected static int
compare(BigDateTimeValueType lhs, BigDateTimeValueType rhs)
compares two BigDateTimeValueType and returns one of the constant defined inComparator
.int
compare(IDateTimeValueType o)
compare two DateTimeValueType as defined in com.sun.msv.datatype/Comparatorprotected java.util.TimeZone
createJavaTimeZone()
Deprecated.usegetTimeZone()
.private static java.math.BigInteger[]
divideAndRemainder(java.math.BigInteger x1, java.math.BigInteger x2)
boolean
equals(BigDateTimeValueType lhs, BigDateTimeValueType rhs)
boolean
equals(IDateTimeValueType rhs)
boolean
equals(java.lang.Object o)
BigDateTimeValueType
getBigValue()
java.lang.Integer
getDay()
java.lang.Integer
getHour()
java.lang.Integer
getMinute()
java.lang.Integer
getMonth()
java.math.BigDecimal
getSecond()
java.util.TimeZone
getTimeZone()
java.math.BigInteger
getYear()
int
hashCode()
IDateTimeValueType
normalize()
gets the normalized IDateTimeValueType.private static java.math.BigDecimal
nullAs0(java.math.BigDecimal o)
private static java.math.BigInteger
nullAs0(java.math.BigInteger o)
private java.math.BigDecimal
signed(BigTimeDurationValueType dur, java.math.BigDecimal i)
private java.math.BigInteger
signed(BigTimeDurationValueType dur, java.math.BigInteger i)
java.util.Calendar
toCalendar()
Approximates the value represented by this object into a Calendar object.java.lang.String
toString()
gets a human-readable representation of this object.
-
-
-
Field Detail
-
year
private java.math.BigInteger year
year value. this variable is null if no year is specified. Since there is no year 0, value 0 indicates year -1. -1 indicates -2, and so forth.
-
month
private java.lang.Integer month
month (always between 0 and 11) this variable is null if no year is specified
-
day
private java.lang.Integer day
day (always normalized, between 0-30) this variable is null if no year is specified
-
hour
private java.lang.Integer hour
hour (always between 0 and 23) this variable is null if no year is specified
-
minute
private java.lang.Integer minute
minute (always between 0 and 59) this variable is null if no year is specified
-
second
private java.math.BigDecimal second
second (always in [0,60) ) this variable is null if no year is specified
-
zone
private java.util.TimeZone zone
time zone specifier. null if missing
-
normalizedValue
private IDateTimeValueType normalizedValue
normalized DateTimeValue of this object. once when the normalized value is computed, the value is kept in this varible so that successive calls to normalize method need not have to compute it again. This approach assumes that modification to the date/time component will never be made.
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BigDateTimeValueType
public BigDateTimeValueType(BigDateTimeValueType base, java.util.TimeZone newTimeZone)
creates an instance with the specified BigDateTimeValueType, with modified time zone. created object shares its date/time value component with the original one, so special care is necessary not to mutate those values.
-
BigDateTimeValueType
public BigDateTimeValueType(java.math.BigInteger year, int month, int day, int hour, int minute, java.math.BigDecimal second, java.util.TimeZone timeZone)
-
BigDateTimeValueType
public BigDateTimeValueType(java.math.BigInteger year, java.lang.Integer month, java.lang.Integer day, java.lang.Integer hour, java.lang.Integer minute, java.math.BigDecimal second, java.util.TimeZone timeZone)
-
BigDateTimeValueType
public BigDateTimeValueType()
-
-
Method Detail
-
getYear
public java.math.BigInteger getYear()
-
getMonth
public java.lang.Integer getMonth()
-
getDay
public java.lang.Integer getDay()
-
getHour
public java.lang.Integer getHour()
-
getMinute
public java.lang.Integer getMinute()
-
getSecond
public java.math.BigDecimal getSecond()
-
getTimeZone
public java.util.TimeZone getTimeZone()
-
getBigValue
public BigDateTimeValueType getBigValue()
- Specified by:
getBigValue
in interfaceIDateTimeValueType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
equals
public boolean equals(IDateTimeValueType rhs)
-
equals
public boolean equals(BigDateTimeValueType lhs, BigDateTimeValueType rhs)
-
toString
public java.lang.String toString()
gets a human-readable representation of this object. return value is not intended to be compliant with the canonical representation of "dateTime" type.- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compare
public int compare(IDateTimeValueType o)
Description copied from interface:IDateTimeValueType
compare two DateTimeValueType as defined in com.sun.msv.datatype/Comparator- Specified by:
compare
in interfaceIDateTimeValueType
-
compare
protected static int compare(BigDateTimeValueType lhs, BigDateTimeValueType rhs)
compares two BigDateTimeValueType and returns one of the constant defined inComparator
. Order-relation between two dateTime is defined in http://www.w3.org/TR/xmlschema-2/#dateTime
-
normalize
public IDateTimeValueType normalize()
Description copied from interface:IDateTimeValueType
gets the normalized IDateTimeValueType. normalized value always has GMT timezone or no timezone- Specified by:
normalize
in interfaceIDateTimeValueType
-
nullAs0
private static java.math.BigInteger nullAs0(java.math.BigInteger o)
-
nullAs0
private static java.math.BigDecimal nullAs0(java.math.BigDecimal o)
-
divideAndRemainder
private static java.math.BigInteger[] divideAndRemainder(java.math.BigInteger x1, java.math.BigInteger x2)
-
add
public IDateTimeValueType add(ITimeDurationValueType _rhs)
Description copied from interface:IDateTimeValueType
returns the result of addition of this object and TimeDuration. this object will not be mutated.- Specified by:
add
in interfaceIDateTimeValueType
-
signed
private java.math.BigInteger signed(BigTimeDurationValueType dur, java.math.BigInteger i)
-
signed
private java.math.BigDecimal signed(BigTimeDurationValueType dur, java.math.BigDecimal i)
-
toCalendar
public java.util.Calendar toCalendar()
Description copied from interface:IDateTimeValueType
Approximates the value represented by this object into a Calendar object. This conversion may lose accuracy.- Specified by:
toCalendar
in interfaceIDateTimeValueType
-
createJavaTimeZone
protected java.util.TimeZone createJavaTimeZone()
Deprecated.usegetTimeZone()
.Creates the equivalent Java TimeZone object.- Returns:
- a non-null valid object.
-
-