Class BigTimeDurationValueType
java.lang.Object
com.sun.msv.datatype.xsd.datetime.BigTimeDurationValueType
- All Implemented Interfaces:
ITimeDurationValueType,Serializable
ITimeDurationValueType implementation that can hold all lexically legal
timeDuration value.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BigIntegerprotected BigIntegerprotected BigIntegerprotected BigIntegerprotected BigDecimalprivate static final longprotected intprivate static final BigDateTimeValueType[]protected BigInteger -
Constructor Summary
ConstructorsConstructorDescriptionBigTimeDurationValueType(int signum, BigInteger year, BigInteger month, BigInteger day, BigInteger hour, BigInteger minute, BigDecimal second) All the fields should be positive and use the signum field to determine the sign.BigTimeDurationValueType(String lexicalRepresentation) Reads in the lexical duration format. -
Method Summary
Modifier and TypeMethodDescriptionprivate static intintcompare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparatorbooleanbooleanstatic BigTimeDurationValueTypefromMinutes(int minutes) static BigTimeDurationValueTypefromMinutes(BigInteger minutes) getDay()getHour()getMonth()private intprivate intgetYear()inthashCode()hash code has to be consistent with equals method.private static booleanisDigit(char ch) private static booleanisDigitOrPeriod(char ch) private BigIntegerprivate static voidorganizeParts(String whole, String[] parts, int[] partsIndex, int len, String tokens) private static BigDecimalparseBigDecimal(String whole, String part, int index) private static BigIntegerparseBigInteger(String whole, String part, int index) private static StringparsePiece(String whole, int[] idx) private voidtoString()
-
Field Details
-
signum
protected int signum -
year
-
month
-
day
-
hour
-
minute
-
second
-
testInstance
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
BigTimeDurationValueType
public BigTimeDurationValueType(int signum, BigInteger year, BigInteger month, BigInteger day, BigInteger hour, BigInteger minute, BigDecimal second) All the fields should be positive and use the signum field to determine the sign. -
BigTimeDurationValueType
Reads in the lexical duration format.- Parameters:
lexicalRepresentation- whitespace stripped lexical form.- Throws:
IllegalArgumentException
-
-
Method Details
-
equals
-
equals
-
toString
-
nullAsZero
-
hashCode
public int hashCode()hash code has to be consistent with equals method. -
compare
Description copied from interface:ITimeDurationValueTypecompare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparator- Specified by:
comparein interfaceITimeDurationValueType
-
compare
-
getBigValue
- Specified by:
getBigValuein interfaceITimeDurationValueType
-
fromMinutes
-
fromMinutes
-
getDay
- Returns:
- non-null positive value. use
signumfor the sign.
-
getHour
- Returns:
- non-null positive value. use
signumfor the sign.
-
getMinute
- Returns:
- non-null positive value. use
signumfor the sign.
-
getMonth
- Returns:
- non-null positive value. use
signumfor the sign.
-
getSecond
- Returns:
- non-null positive value. use
signumfor the sign.
-
getYear
- Returns:
- non-null positive value. use
signumfor the sign.
-
getSignum
-
getSignum
-
isDigit
private static boolean isDigit(char ch) -
isDigitOrPeriod
private static boolean isDigitOrPeriod(char ch) -
parsePiece
- Throws:
IllegalArgumentException
-
organizeParts
private static void organizeParts(String whole, String[] parts, int[] partsIndex, int len, String tokens) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
parseBigInteger
private static BigInteger parseBigInteger(String whole, String part, int index) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
parseBigDecimal
private static BigDecimal parseBigDecimal(String whole, String part, int index) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
readObject
- Throws:
IOExceptionClassNotFoundException
-