public final class BigIntegerValue extends IntegerValue
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BigIntegerValue.BigIntegerComparable
A Comparable that performs comparison of BigInteger values either with other
BigInteger values or with other representations of XPath numeric values
|
| Modifier and Type | Field and Description |
|---|---|
static java.math.BigInteger |
MAX_LONG |
static java.math.BigInteger |
MAX_UNSIGNED_LONG |
static java.math.BigInteger |
MIN_LONG |
static BigIntegerValue |
ZERO |
typeLabelNaN_MATCH_KEY| Constructor and Description |
|---|
BigIntegerValue(java.math.BigInteger value)
Construct an xs:integer value from a Java BigInteger
|
BigIntegerValue(java.math.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.
|
| Modifier and Type | Method and Description |
|---|---|
NumericValue |
abs()
Get the absolute value as defined by the XPath abs() function
|
BigIntegerValue |
asAtomic()
Calling this method on a ConversionResult returns the AtomicValue that results
from the conversion if the conversion was successful, and throws a ValidationException
explaining the conversion error otherwise.
|
java.math.BigInteger |
asBigInteger()
Get the value as a BigInteger
|
java.math.BigDecimal |
asDecimal()
Convert the value to a BigDecimal
|
int |
asSubscript()
Test whether a number is a possible subscript into a sequence, that is,
a whole number greater than zero and less than 2^31
|
NumericValue |
ceiling()
Implement the XPath ceiling() function
|
int |
compareTo(long other)
Compare the value to a long
|
int |
compareTo(NumericValue other)
Compare the value to another numeric value
|
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
|
java.math.BigDecimal |
getDecimalValue()
Get the numeric value converted to a decimal
|
double |
getDoubleValue()
Get the numeric value as a double
|
float |
getFloatValue()
Get the numeric value converted to a float
|
java.lang.String |
getPrimitiveStringValue()
Get the value as a String
|
java.lang.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
|
IntegerValue |
reduce()
Reduce a value to its simplest form.
|
NumericValue |
round(int scale)
Implement the XPath round() function
|
NumericValue |
roundHalfToEven(int scale)
Implement the XPath round-to-half-even() function
|
int |
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.
|
castableAsInteger, checkBigRange, checkRange, div, getMaxInclusive, getMinInclusive, getPrimitiveType, idiv, isIdentical, makeIntegerValue, makeIntegerValue, makeIntegerValue, mod, signum, stringToIntegerequals, getXPathComparable, isInteger, isNegativeZero, parseNumber, toStringasMapKey, atomize, checkPermittedContents, checkValidInJavascript, getCanonicalLexicalRepresentation, getCardinality, getComponent, getGenre, getItemType, getLength, getStringValue, getStringValueCS, getUType, head, identityHashCode, isIdentical, isNaN, itemAt, iterate, iterator, process, setTypeLabelclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStreamed, subsequence, toGroundedValue, toShortStringasIterable, materializemakeRepeatablepublic static final java.math.BigInteger MAX_LONG
public static final java.math.BigInteger MIN_LONG
public static final java.math.BigInteger MAX_UNSIGNED_LONG
public static final BigIntegerValue ZERO
public BigIntegerValue(java.math.BigInteger value)
value - the supplied BigIntegerpublic BigIntegerValue(java.math.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 longpublic 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 subtypepublic ValidationFailure validateAgainstSubType(BuiltInAtomicType type)
validateAgainstSubType in class IntegerValuetype - the subtype of integer requiredpublic int hashCode()
hashCode in class NumericValueNumericValue.hashCode()public long longValue()
longValue in class NumericValuepublic java.math.BigInteger asBigInteger()
asBigInteger in class IntegerValuepublic boolean isWithinLongRange()
public java.math.BigDecimal asDecimal()
public boolean effectiveBooleanValue()
effectiveBooleanValue in interface GroundedValue<AtomicValue>effectiveBooleanValue in class NumericValuepublic int compareTo(NumericValue other)
compareTo in interface java.lang.Comparable<NumericValue>compareTo in class NumericValueother - the numeric value to be compared to this valuepublic int compareTo(long other)
compareTo in class NumericValueother - the value to be compared withpublic java.lang.String getPrimitiveStringValue()
getPrimitiveStringValue in class AtomicValuepublic double getDoubleValue()
getDoubleValue in class NumericValuepublic java.math.BigDecimal getDecimalValue()
getDecimalValue in class IntegerValuepublic float getFloatValue()
getFloatValue in class NumericValuepublic NumericValue negate()
negate in class NumericValuepublic NumericValue floor()
floor in class NumericValuepublic NumericValue ceiling()
ceiling in class NumericValuepublic NumericValue round(int scale)
round in class NumericValuescale - the number of decimal places required in the result (supply 0 for rounding to an integer)public 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 100public int signum()
signum in class NumericValuepublic NumericValue abs()
abs in class NumericValuepublic boolean isWholeNumber()
isWholeNumber in class IntegerValuepublic int asSubscript()
asSubscript in class NumericValuepublic IntegerValue plus(IntegerValue other)
plus in class IntegerValueother - the other integerpublic IntegerValue minus(IntegerValue other)
minus in class IntegerValueother - the other integerpublic IntegerValue times(IntegerValue other)
times in class IntegerValueother - the other integerpublic NumericValue div(IntegerValue other) throws XPathException
div in class IntegerValueother - the other integerXPathException - if the other integer is zeropublic IntegerValue mod(IntegerValue other) throws XPathException
mod in class IntegerValueother - the other integerXPathException - if the other integer is zeropublic IntegerValue idiv(IntegerValue other) throws XPathException
idiv in class IntegerValueother - the other integerXPathException - if the other integer is zeropublic java.lang.Comparable getSchemaComparable()
getSchemaComparable in interface AtomicSequencegetSchemaComparable in class AtomicValuepublic IntegerValue reduce()
public BigIntegerValue asAtomic()
AtomicValueUse this method if you are calling a conversion method that returns a ConversionResult, and if you want to throw an exception if the conversion fails.
asAtomic in interface AtomicMatchKeyasAtomic in interface ConversionResultasAtomic in class AtomicValueCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.