Class BigTimeDurationValueType
- java.lang.Object
-
- com.sun.msv.datatype.xsd.datetime.BigTimeDurationValueType
-
- All Implemented Interfaces:
ITimeDurationValueType,java.io.Serializable
public class BigTimeDurationValueType extends java.lang.Object implements ITimeDurationValueType
ITimeDurationValueType implementation that can hold all lexically legal timeDuration value.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.math.BigIntegerdayprotected java.math.BigIntegerhourprotected java.math.BigIntegerminuteprotected java.math.BigIntegermonthprotected java.math.BigDecimalsecondprivate static longserialVersionUIDprotected intsignumprivate static BigDateTimeValueType[]testInstanceprotected java.math.BigIntegeryear
-
Constructor Summary
Constructors Constructor Description BigTimeDurationValueType(int signum, java.math.BigInteger year, java.math.BigInteger month, java.math.BigInteger day, java.math.BigInteger hour, java.math.BigInteger minute, java.math.BigDecimal second)All the fields should be positive and use the signum field to determine the sign.BigTimeDurationValueType(java.lang.String lexicalRepresentation)Reads in the lexical duration format.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcompare(BigTimeDurationValueType lhs, BigTimeDurationValueType rhs)intcompare(ITimeDurationValueType o)compare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparatorbooleanequals(ITimeDurationValueType o)booleanequals(java.lang.Object o)static BigTimeDurationValueTypefromMinutes(int minutes)static BigTimeDurationValueTypefromMinutes(java.math.BigInteger minutes)BigTimeDurationValueTypegetBigValue()java.math.BigIntegergetDay()java.math.BigIntegergetHour()java.math.BigIntegergetMinute()java.math.BigIntegergetMonth()java.math.BigDecimalgetSecond()private intgetSignum(java.math.BigDecimal i)private intgetSignum(java.math.BigInteger i)java.math.BigIntegergetYear()inthashCode()hash code has to be consistent with equals method.private static booleanisDigit(char ch)private static booleanisDigitOrPeriod(char ch)private java.math.BigIntegernullAsZero(java.math.BigInteger o)private static voidorganizeParts(java.lang.String whole, java.lang.String[] parts, int[] partsIndex, int len, java.lang.String tokens)private static java.math.BigDecimalparseBigDecimal(java.lang.String whole, java.lang.String part, int index)private static java.math.BigIntegerparseBigInteger(java.lang.String whole, java.lang.String part, int index)private static java.lang.StringparsePiece(java.lang.String whole, int[] idx)private voidreadObject(java.io.ObjectInputStream ois)java.lang.StringtoString()
-
-
-
Field Detail
-
signum
protected int signum
-
year
protected java.math.BigInteger year
-
month
protected java.math.BigInteger month
-
day
protected java.math.BigInteger day
-
hour
protected java.math.BigInteger hour
-
minute
protected java.math.BigInteger minute
-
second
protected java.math.BigDecimal second
-
testInstance
private static final BigDateTimeValueType[] testInstance
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BigTimeDurationValueType
public BigTimeDurationValueType(int signum, java.math.BigInteger year, java.math.BigInteger month, java.math.BigInteger day, java.math.BigInteger hour, java.math.BigInteger minute, java.math.BigDecimal second)All the fields should be positive and use the signum field to determine the sign.
-
BigTimeDurationValueType
public BigTimeDurationValueType(java.lang.String lexicalRepresentation) throws java.lang.IllegalArgumentExceptionReads in the lexical duration format.- Parameters:
lexicalRepresentation- whitespace stripped lexical form.- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
equals
public boolean equals(ITimeDurationValueType o)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
nullAsZero
private java.math.BigInteger nullAsZero(java.math.BigInteger o)
-
hashCode
public int hashCode()
hash code has to be consistent with equals method.- Overrides:
hashCodein classjava.lang.Object
-
compare
public int compare(ITimeDurationValueType o)
Description copied from interface:ITimeDurationValueTypecompare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparator- Specified by:
comparein interfaceITimeDurationValueType
-
compare
private static int compare(BigTimeDurationValueType lhs, BigTimeDurationValueType rhs)
-
getBigValue
public BigTimeDurationValueType getBigValue()
- Specified by:
getBigValuein interfaceITimeDurationValueType
-
fromMinutes
public static BigTimeDurationValueType fromMinutes(int minutes)
-
fromMinutes
public static BigTimeDurationValueType fromMinutes(java.math.BigInteger minutes)
-
getDay
public java.math.BigInteger getDay()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getHour
public java.math.BigInteger getHour()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getMinute
public java.math.BigInteger getMinute()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getMonth
public java.math.BigInteger getMonth()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getSecond
public java.math.BigDecimal getSecond()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getYear
public java.math.BigInteger getYear()
- Returns:
- non-null positive value. use
signumfor the sign.
-
getSignum
private int getSignum(java.math.BigInteger i)
-
getSignum
private int getSignum(java.math.BigDecimal i)
-
isDigit
private static boolean isDigit(char ch)
-
isDigitOrPeriod
private static boolean isDigitOrPeriod(char ch)
-
parsePiece
private static java.lang.String parsePiece(java.lang.String whole, int[] idx) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
organizeParts
private static void organizeParts(java.lang.String whole, java.lang.String[] parts, int[] partsIndex, int len, java.lang.String tokens) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
parseBigInteger
private static java.math.BigInteger parseBigInteger(java.lang.String whole, java.lang.String part, int index) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
parseBigDecimal
private static java.math.BigDecimal parseBigDecimal(java.lang.String whole, java.lang.String part, int index) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
readObject
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-