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.Integerdayday (always normalized, between 0-30) this variable is null if no year is specifiedprivate java.lang.Integerhourhour (always between 0 and 23) this variable is null if no year is specifiedprivate java.lang.Integerminuteminute (always between 0 and 59) this variable is null if no year is specifiedprivate java.lang.Integermonthmonth (always between 0 and 11) this variable is null if no year is specifiedprivate IDateTimeValueTypenormalizedValuenormalized DateTimeValue of this object.private java.math.BigDecimalsecondsecond (always in [0,60) ) this variable is null if no year is specifiedprivate static longserialVersionUIDprivate java.math.BigIntegeryearyear value.private java.util.TimeZonezonetime 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 IDateTimeValueTypeadd(ITimeDurationValueType _rhs)returns the result of addition of this object and TimeDuration.protected static intcompare(BigDateTimeValueType lhs, BigDateTimeValueType rhs)compares two BigDateTimeValueType and returns one of the constant defined inComparator.intcompare(IDateTimeValueType o)compare two DateTimeValueType as defined in com.sun.msv.datatype/Comparatorprotected java.util.TimeZonecreateJavaTimeZone()Deprecated.usegetTimeZone().private static java.math.BigInteger[]divideAndRemainder(java.math.BigInteger x1, java.math.BigInteger x2)booleanequals(BigDateTimeValueType lhs, BigDateTimeValueType rhs)booleanequals(IDateTimeValueType rhs)booleanequals(java.lang.Object o)BigDateTimeValueTypegetBigValue()java.lang.IntegergetDay()java.lang.IntegergetHour()java.lang.IntegergetMinute()java.lang.IntegergetMonth()java.math.BigDecimalgetSecond()java.util.TimeZonegetTimeZone()java.math.BigIntegergetYear()inthashCode()IDateTimeValueTypenormalize()gets the normalized IDateTimeValueType.private static java.math.BigDecimalnullAs0(java.math.BigDecimal o)private static java.math.BigIntegernullAs0(java.math.BigInteger o)private java.math.BigDecimalsigned(BigTimeDurationValueType dur, java.math.BigDecimal i)private java.math.BigIntegersigned(BigTimeDurationValueType dur, java.math.BigInteger i)java.util.CalendartoCalendar()Approximates the value represented by this object into a Calendar object.java.lang.StringtoString()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:
getBigValuein interfaceIDateTimeValueType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin 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:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compare
public int compare(IDateTimeValueType o)
Description copied from interface:IDateTimeValueTypecompare two DateTimeValueType as defined in com.sun.msv.datatype/Comparator- Specified by:
comparein 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:IDateTimeValueTypegets the normalized IDateTimeValueType. normalized value always has GMT timezone or no timezone- Specified by:
normalizein 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:IDateTimeValueTypereturns the result of addition of this object and TimeDuration. this object will not be mutated.- Specified by:
addin 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:IDateTimeValueTypeApproximates the value represented by this object into a Calendar object. This conversion may lose accuracy.- Specified by:
toCalendarin interfaceIDateTimeValueType
-
createJavaTimeZone
protected java.util.TimeZone createJavaTimeZone()
Deprecated.usegetTimeZone().Creates the equivalent Java TimeZone object.- Returns:
- a non-null valid object.
-
-