public final class Int64Value extends IntegerValue
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Int64Value.Int64Comparable
A Comparable that performs comparison of an Int64Value either with another
Int64Value or with some other representation of an XPath numeric value
|
MAX_LONG, MIN_LONG, MINUS_ONE, PLUS_ONE, ZEROtypeLabel| Constructor and Description |
|---|
Int64Value(long value)
Constructor supplying a long
|
Int64Value(long val,
BuiltInAtomicType type,
boolean check)
Constructor for a subtype, supplying a long and a type label.
|
| Modifier and Type | Method and Description |
|---|---|
NumericValue |
abs()
Get the absolute value as defined by the XPath abs() function
|
BigInteger |
asBigInteger()
Get the value as a BigInteger
|
NumericValue |
ceiling()
Implement the XPath ceiling() function
|
boolean |
checkRange(BuiltInAtomicType type)
This class allows subtypes of xs:integer to be held, as well as xs:integer values.
|
int |
compareTo(long other)
Compare the value to a long
|
int |
compareTo(Object other)
Compare the value to another numeric value
|
ValidationFailure |
convertToSubType(BuiltInAtomicType subtype,
boolean validate)
Convert the value to a subtype of xs:integer
|
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
|
float |
getFloatValue()
Get the numeric value converted to a float
|
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
|
long |
longValue()
Get the value
|
static Int64Value |
makeDerived(long val,
AtomicType type)
Factory method to create a derived value, with no checking of the value against the
derived type
|
static Int64Value |
makeIntegerValue(long value)
Factory method: allows Int64Value objects to be reused.
|
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
|
NumericValue |
round(int scale)
Implement the XPath round() function
|
NumericValue |
roundHalfToEven(int scale)
Implement the XPath round-to-half-even() function
|
void |
setSubType(AtomicType type)
This class allows subtypes of xs:integer to be held, as well as xs:integer values.
|
int |
signum()
Determine whether the value is negative, zero, or positive
|
static Int64Value |
signum(long val)
Factory method returning the integer -1, 0, or +1 according as the argument
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, getMaxInclusive, getMinInclusive, getPrimitiveType, isIdentical, isWholeNumber, makeIntegerValue, makeIntegerValue, makeIntegerValue, signum, stringToIntegerequals, getXPathComparable, isInteger, parseNumber, toStringasAtomic, checkPermittedContents, getCanonicalLexicalRepresentation, getCardinality, getComponent, getItemType, getStringValue, getStringValueCS, head, isIdentical, isNaN, itemAt, iterate, process, setTypeLabelgetLength, reduce, subsequenceclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetLengthreduce, subsequencepublic Int64Value(long value)
value - the value of the IntegerValuepublic Int64Value(long val,
BuiltInAtomicType type,
boolean check)
throws XPathException
val - The supplied value, as an integertype - the required item type, a subtype of xs:integercheck - Set to true if the method is required to check that the value is in range;
false if the caller can guarantee that the value has already been checked.XPathException - if the supplied value is out of range for the
target typepublic static Int64Value makeIntegerValue(long value)
value - the integer valuepublic static Int64Value makeDerived(long val, AtomicType type)
val - the integer valuetype - the subtype of xs:integerpublic static Int64Value signum(long val)
val - the value to be testedpublic 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 subtype, boolean validate)
convertToSubType in class IntegerValuesubtype - the target subtypevalidate - true if validation is required; false if the caller already knows that the value is validpublic ValidationFailure validateAgainstSubType(BuiltInAtomicType type)
validateAgainstSubType in class IntegerValuetype - the subtype of integer requiredpublic void setSubType(AtomicType type)
type - the type label to be assignedpublic boolean checkRange(BuiltInAtomicType type)
type - the subtype of integer requiredpublic Comparable getSchemaComparable()
getSchemaComparable in interface AtomicSequencegetSchemaComparable in class AtomicValuepublic int hashCode()
hashCode in class NumericValueNumericValue.hashCode()public long longValue()
longValue in class NumericValuepublic boolean effectiveBooleanValue()
effectiveBooleanValue in interface GroundedValueeffectiveBooleanValue in class AtomicValuepublic int compareTo(Object other)
compareTo in interface ComparablecompareTo 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 String getPrimitiveStringValue()
getPrimitiveStringValue in class AtomicValuepublic double getDoubleValue()
getDoubleValue in class NumericValuepublic float getFloatValue()
getFloatValue 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(int scale)
round in class NumericValuescale - the scale (for example scale=2 rounds to 2 decimal places, scale=-2
rounds to a multiple of 100); default value is zero which rounds to an integerpublic 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 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 BigInteger asBigInteger()
asBigInteger in class IntegerValueCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.