|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.sf.saxon.value.Value
net.sf.saxon.value.AtomicValue
net.sf.saxon.value.NumericValue
net.sf.saxon.value.IntegerValue
net.sf.saxon.value.BigIntegerValue
public final class BigIntegerValue
An integer value: note this is a subtype of decimal in XML Schema, not a primitive type. The abstract class IntegerValue is used to represent any xs:integer value; this implementation is used for values that do not fit comfortably in a Java long; including the built-in subtype xs:unsignedLong
| Nested Class Summary | |
|---|---|
protected static class |
BigIntegerValue.BigIntegerComparable
|
| Field Summary | |
|---|---|
static BigInteger |
MAX_LONG
|
static BigInteger |
MAX_UNSIGNED_LONG
|
static BigInteger |
MIN_LONG
|
static BigIntegerValue |
ZERO
|
| Fields inherited from class net.sf.saxon.value.IntegerValue |
|---|
MINUS_ONE, PLUS_ONE, SMALL_INTEGERS |
| Fields inherited from class net.sf.saxon.value.AtomicValue |
|---|
typeLabel |
| Fields inherited from class net.sf.saxon.value.Value |
|---|
INDETERMINATE_ORDERING |
| Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
|---|
EMPTY_VALUE_ARRAY |
| Constructor Summary | |
|---|---|
BigIntegerValue(BigInteger value)
Construct an xs:integer value from a Java BigInteger |
|
BigIntegerValue(BigInteger value,
AtomicType typeLabel)
Construct an xs:integer value from a Java BigInteger, supplying a type label. |
|
BigIntegerValue(long value)
Construct an xs:integer value from a Java long. |
|
| Method Summary | |
|---|---|
NumericValue |
abs()
Get the absolute value as defined by the XPath abs() function |
BigInteger |
asBigInteger()
Get the value as a BigInteger |
BigDecimal |
asDecimal()
Convert the value to a BigDecimal |
NumericValue |
ceiling()
Implement the XPath ceiling() function |
int |
compareTo(long other)
Compare the value to a long |
int |
compareTo(Object other)
Compare the value to another numeric value |
ConversionResult |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert to target data type |
ValidationFailure |
convertToSubType(BuiltInAtomicType type,
boolean validate)
This class allows subtypes of xs:integer to be held, as well as xs:integer values. |
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label |
NumericValue |
div(IntegerValue other)
Divide by another integer |
boolean |
effectiveBooleanValue()
Return the effective boolean value of this integer |
NumericValue |
floor()
Implement the XPath floor() function |
BigDecimal |
getDecimalValue()
Get the numeric value converted to a decimal |
double |
getDoubleValue()
Get the numeric value as a double |
String |
getPrimitiveStringValue()
Get the value as a String |
Comparable |
getSchemaComparable()
Get an object that implements XML Schema comparison semantics |
int |
hashCode()
Get the hashCode. |
IntegerValue |
idiv(IntegerValue other)
Integer divide by another integer |
boolean |
isWholeNumber()
Determine whether the value is a whole number, that is, whether it compares equal to some integer |
boolean |
isWithinLongRange()
Test whether the value is within the range that can be held in a 64-bit signed integer |
long |
longValue()
Get the value as a long |
IntegerValue |
minus(IntegerValue other)
Subtract another integer |
IntegerValue |
mod(IntegerValue other)
Take modulo another integer |
NumericValue |
negate()
Negate the value |
IntegerValue |
plus(IntegerValue other)
Add another integer |
Value |
reduce()
Reduce a value to its simplest form. |
NumericValue |
round()
Implement the XPath round() function |
NumericValue |
roundHalfToEven(int scale)
Implement the XPath round-to-half-even() function |
double |
signum()
Determine whether the value is negative, zero, or positive |
IntegerValue |
times(IntegerValue other)
Multiply by another integer |
ValidationFailure |
validateAgainstSubType(BuiltInAtomicType type)
This class allows subtypes of xs:integer to be held, as well as xs:integer values. |
| Methods inherited from class net.sf.saxon.value.IntegerValue |
|---|
checkBigRange, checkRange, getPrimitiveType, isIdentical, makeIntegerValue, signum, stringToInteger |
| Methods inherited from class net.sf.saxon.value.NumericValue |
|---|
equals, getFloatValue, getXPathComparable, isInteger, parseNumber, promote, toString |
| Methods inherited from class net.sf.saxon.value.AtomicValue |
|---|
asAtomic, checkPermittedContents, convert, convert, getCardinality, getComponent, getItemType, getLength, getStringValue, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence |
| Methods inherited from class net.sf.saxon.value.Value |
|---|
asItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, stringToNumber |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final BigInteger MAX_LONG
public static final BigInteger MIN_LONG
public static final BigInteger MAX_UNSIGNED_LONG
public static final BigIntegerValue ZERO
| Constructor Detail |
|---|
public BigIntegerValue(BigInteger value)
value - the supplied BigInteger
public BigIntegerValue(BigInteger value,
AtomicType typeLabel)
value - the value of the integertypeLabel - the type, which must represent a type derived from xs:integerpublic BigIntegerValue(long value)
value - the supplied Java long| Method Detail |
|---|
public AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType in class AtomicValuetypeLabel - the type label of the new copy. The caller is responsible for checking that
the value actually conforms to this type.
public ValidationFailure convertToSubType(BuiltInAtomicType type,
boolean validate)
convertToSubType in class IntegerValuetype - the subtype of integer requiredvalidate - true if validation is required, false if the caller warrants that the value
is valid for the subtype
public ValidationFailure validateAgainstSubType(BuiltInAtomicType type)
validateAgainstSubType in class IntegerValuetype - the subtype of integer required
public int hashCode()
hashCode in class NumericValueNumericValue.hashCode()public long longValue()
longValue in class NumericValuepublic BigInteger asBigInteger()
asBigInteger in class IntegerValuepublic boolean isWithinLongRange()
public BigDecimal asDecimal()
public boolean effectiveBooleanValue()
effectiveBooleanValue in class AtomicValuepublic int compareTo(Object other)
compareTo in interface ComparablecompareTo in class NumericValueother - the numeric value to be compared to this value
public int compareTo(long other)
compareTo in class NumericValueother - the value to be compared with
public ConversionResult convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
convertPrimitive in class AtomicValuerequiredType - identifies the required atomic typecontext - the XPath dynamic evaluation contextvalidate - true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation
is therefore not required.
Note that a validation failure may be reported even if validation was not requested.
public String getPrimitiveStringValue()
getPrimitiveStringValue in class AtomicValuepublic double getDoubleValue()
getDoubleValue in class NumericValuepublic BigDecimal getDecimalValue()
getDecimalValue in class NumericValuepublic NumericValue negate()
negate in class NumericValuepublic NumericValue floor()
floor in class NumericValuepublic NumericValue ceiling()
ceiling in class NumericValuepublic NumericValue round()
round in class NumericValuepublic NumericValue roundHalfToEven(int scale)
roundHalfToEven in class NumericValuescale - number of digits required after the decimal point; the
value -2 (for example) means round to a multiple of 100
public double signum()
signum in class NumericValuepublic NumericValue abs()
abs in class NumericValuepublic boolean isWholeNumber()
isWholeNumber in class IntegerValuepublic IntegerValue plus(IntegerValue other)
plus in class IntegerValueother - the other integer
public IntegerValue minus(IntegerValue other)
minus in class IntegerValueother - the other integer
public IntegerValue times(IntegerValue other)
times in class IntegerValueother - the other integer
public NumericValue div(IntegerValue other)
throws XPathException
div in class IntegerValueother - the other integer
XPathException - if the other integer is zero
public IntegerValue mod(IntegerValue other)
throws XPathException
mod in class IntegerValueother - the other integer
XPathException - if the other integer is zero
public IntegerValue idiv(IntegerValue other)
throws XPathException
idiv in class IntegerValueother - the other integer
XPathException - if the other integer is zeropublic Comparable getSchemaComparable()
getSchemaComparable in class AtomicValue
public Value reduce()
throws XPathException
reduce in class ValueXPathException
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||