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.BigInteger
day
protected java.math.BigInteger
hour
protected java.math.BigInteger
minute
protected java.math.BigInteger
month
protected java.math.BigDecimal
second
private static long
serialVersionUID
protected int
signum
private static BigDateTimeValueType[]
testInstance
protected java.math.BigInteger
year
-
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 int
compare(BigTimeDurationValueType lhs, BigTimeDurationValueType rhs)
int
compare(ITimeDurationValueType o)
compare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparatorboolean
equals(ITimeDurationValueType o)
boolean
equals(java.lang.Object o)
static BigTimeDurationValueType
fromMinutes(int minutes)
static BigTimeDurationValueType
fromMinutes(java.math.BigInteger minutes)
BigTimeDurationValueType
getBigValue()
java.math.BigInteger
getDay()
java.math.BigInteger
getHour()
java.math.BigInteger
getMinute()
java.math.BigInteger
getMonth()
java.math.BigDecimal
getSecond()
private int
getSignum(java.math.BigDecimal i)
private int
getSignum(java.math.BigInteger i)
java.math.BigInteger
getYear()
int
hashCode()
hash code has to be consistent with equals method.private static boolean
isDigit(char ch)
private static boolean
isDigitOrPeriod(char ch)
private java.math.BigInteger
nullAsZero(java.math.BigInteger o)
private static void
organizeParts(java.lang.String whole, java.lang.String[] parts, int[] partsIndex, int len, java.lang.String tokens)
private static java.math.BigDecimal
parseBigDecimal(java.lang.String whole, java.lang.String part, int index)
private static java.math.BigInteger
parseBigInteger(java.lang.String whole, java.lang.String part, int index)
private static java.lang.String
parsePiece(java.lang.String whole, int[] idx)
private void
readObject(java.io.ObjectInputStream ois)
java.lang.String
toString()
-
-
-
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.IllegalArgumentException
Reads 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:
equals
in classjava.lang.Object
-
equals
public boolean equals(ITimeDurationValueType o)
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
hashCode
in classjava.lang.Object
-
compare
public int compare(ITimeDurationValueType o)
Description copied from interface:ITimeDurationValueType
compare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparator- Specified by:
compare
in interfaceITimeDurationValueType
-
compare
private static int compare(BigTimeDurationValueType lhs, BigTimeDurationValueType rhs)
-
getBigValue
public BigTimeDurationValueType getBigValue()
- Specified by:
getBigValue
in 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
signum
for the sign.
-
getHour
public java.math.BigInteger getHour()
- Returns:
- non-null positive value. use
signum
for the sign.
-
getMinute
public java.math.BigInteger getMinute()
- Returns:
- non-null positive value. use
signum
for the sign.
-
getMonth
public java.math.BigInteger getMonth()
- Returns:
- non-null positive value. use
signum
for the sign.
-
getSecond
public java.math.BigDecimal getSecond()
- Returns:
- non-null positive value. use
signum
for the sign.
-
getYear
public java.math.BigInteger getYear()
- Returns:
- non-null positive value. use
signum
for 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.IOException
java.lang.ClassNotFoundException
-
-