Top Description Fields Constructors Methods
com.sun.msv.datatype.xsd.datetime

public Class BigTimeDurationValueType

extends Object
implements ITimeDurationValueType
Class Inheritance
All Implemented Interfaces
com.sun.msv.datatype.xsd.datetime.ITimeDurationValueType, java.io.Serializable
Imports
com.sun.msv.datatype.xsd.Comparator, java.io.IOException, .ObjectInputStream, java.math.BigDecimal, .BigInteger

ITimeDurationValueType implementation that can hold all lexically legal timeDuration value.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected BigInteger
protected BigInteger
protected BigInteger
protected BigInteger
protected BigDecimal
private static final long
protected int
private static final BigDateTimeValueType[]
protected BigInteger

Constructor Summary

AccessConstructor and Description
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.

public
BigTimeDurationValueType(String
whitespace stripped lexical form.
lexicalRepresentation
)

Reads in the lexical duration format.

Method Summary

Modifier and TypeMethod and Description
public int
compare(ITimeDurationValueType o)

Implements com.sun.msv.datatype.xsd.datetime.ITimeDurationValueType.compare.

compare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparator
private static int
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public boolean
public static BigTimeDurationValueType
fromMinutes(int minutes)

public static BigTimeDurationValueType
public BigTimeDurationValueType
public BigInteger

Returns:

non-null positive value. use signum for the sign.
getDay
()

public BigInteger

Returns:

non-null positive value. use signum for the sign.
getHour
()

public BigInteger

Returns:

non-null positive value. use signum for the sign.
getMinute
()

public BigInteger

Returns:

non-null positive value. use signum for the sign.
getMonth
()

public BigDecimal

Returns:

non-null positive value. use signum for the sign.
getSecond
()

private int
private int
public BigInteger

Returns:

non-null positive value. use signum for the sign.
getYear
()

public int
hashCode()

Overrides java.lang.Object.hashCode.

hash code has to be consistent with equals method.
private static boolean
isDigit(char ch)

private static boolean
isDigitOrPeriod(char ch)

private BigInteger
private static void
organizeParts(String whole, String[] parts, int[] partsIndex, int len, String tokens)

private static BigDecimal
parseBigDecimal(String whole, String part, int index)

private static BigInteger
parseBigInteger(String whole, String part, int index)

private static String
parsePiece(String whole, int[] idx)

private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

dayback to summary
protected BigInteger day
hourback to summary
protected BigInteger hour
minuteback to summary
protected BigInteger minute
monthback to summary
protected BigInteger month
secondback to summary
protected BigDecimal second
serialVersionUIDback to summary
private static final long serialVersionUID
signumback to summary
protected int signum
testInstanceback to summary
private static final BigDateTimeValueType[] testInstance
yearback to summary
protected BigInteger year

Constructor Detail

BigTimeDurationValueTypeback to summary
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.

BigTimeDurationValueTypeback to summary
public BigTimeDurationValueType(String lexicalRepresentation) throws IllegalArgumentException

Reads in the lexical duration format.

Parameters
lexicalRepresentation:String

whitespace stripped lexical form.

Method Detail

compareback to summary
public int compare(ITimeDurationValueType o)

Implements com.sun.msv.datatype.xsd.datetime.ITimeDurationValueType.compare.

Doc from com.sun.msv.datatype.xsd.datetime.ITimeDurationValueType.compare.

compare two ITimeDurationValueType as defined in com.sun.msv.datatype/Comparator

compareback to summary
private static int compare(BigTimeDurationValueType lhs, BigTimeDurationValueType rhs)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

equalsback to summary
public boolean equals(ITimeDurationValueType o)
fromMinutesback to summary
public static BigTimeDurationValueType fromMinutes(int minutes)
fromMinutesback to summary
public static BigTimeDurationValueType fromMinutes(BigInteger minutes)
getBigValueback to summary
public BigTimeDurationValueType getBigValue()

Implements com.sun.msv.datatype.xsd.datetime.ITimeDurationValueType.getBigValue.

getDayback to summary
public BigInteger getDay()
Returns:BigInteger

non-null positive value. use signum for the sign.

getHourback to summary
public BigInteger getHour()
Returns:BigInteger

non-null positive value. use signum for the sign.

getMinuteback to summary
public BigInteger getMinute()
Returns:BigInteger

non-null positive value. use signum for the sign.

getMonthback to summary
public BigInteger getMonth()
Returns:BigInteger

non-null positive value. use signum for the sign.

getSecondback to summary
public BigDecimal getSecond()
Returns:BigDecimal

non-null positive value. use signum for the sign.

getSignumback to summary
private int getSignum(BigInteger i)
getSignumback to summary
private int getSignum(BigDecimal i)
getYearback to summary
public BigInteger getYear()
Returns:BigInteger

non-null positive value. use signum for the sign.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

hash code has to be consistent with equals method.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

isDigitback to summary
private static boolean isDigit(char ch)
isDigitOrPeriodback to summary
private static boolean isDigitOrPeriod(char ch)
nullAsZeroback to summary
private BigInteger nullAsZero(BigInteger o)
organizePartsback to summary
private static void organizeParts(String whole, String[] parts, int[] partsIndex, int len, String tokens) throws IllegalArgumentException
parseBigDecimalback to summary
private static BigDecimal parseBigDecimal(String whole, String part, int index) throws IllegalArgumentException
parseBigIntegerback to summary
private static BigInteger parseBigInteger(String whole, String part, int index) throws IllegalArgumentException
parsePieceback to summary
private static String parsePiece(String whole, int[] idx) throws IllegalArgumentException
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.