|
|||||||
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
public abstract class IntegerValue
This class represents the XPath built-in type xs:integer. It is used for all
subtypes of xs:integer, other than user-defined subtypes. There are two implementations
of IntegerValue: Int64Value
, which accommodates values up to 2^63, and
BigIntegerValue
, which accommodates unlimited-length integers.
Field Summary | |
---|---|
static Int64Value |
MAX_LONG
IntegerValue representing the maximum value for a long |
static Int64Value |
MIN_LONG
IntegerValue representing the minimum value for a long |
static Int64Value |
MINUS_ONE
IntegerValue representing the value -1 |
static Int64Value |
PLUS_ONE
IntegerValue representing the value +1 |
static Int64Value[] |
SMALL_INTEGERS
Array of small integer values |
static Int64Value |
ZERO
IntegerValue representing the value zero |
Fields inherited from class net.sf.saxon.value.Value |
---|
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Constructor Summary | |
---|---|
IntegerValue()
|
Method Summary | |
---|---|
abstract BigInteger |
asBigInteger()
Get the value as a BigInteger |
static boolean |
checkBigRange(BigInteger big,
AtomicType type)
Check that a BigInteger is within the required range for a given integer subtype. |
static boolean |
checkRange(long value,
AtomicType type)
Check that a value is in range for the specified subtype of xs:integer |
abstract ValidationException |
convertToSubType(AtomicType type,
boolean validate)
This class allows subtypes of xs:integer to be held, as well as xs:integer values. |
abstract NumericValue |
div(IntegerValue other)
Divide by another integer |
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value. |
Comparable |
getSchemaComparable()
Get an object that implements XML Schema comparison semantics |
abstract 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 |
static IntegerValue |
makeIntegerValue(BigInteger value)
Factory method: makes either an Int64Value or a BigIntegerValue depending on the value supplied |
abstract IntegerValue |
minus(IntegerValue other)
Subtract another integer |
abstract IntegerValue |
mod(IntegerValue other)
Take modulo another integer |
abstract IntegerValue |
plus(IntegerValue other)
Add another integer |
static AtomicValue |
stringToInteger(CharSequence s)
Static factory method to convert strings to integers. |
abstract IntegerValue |
times(IntegerValue other)
Multiply by another integer |
Methods inherited from class net.sf.saxon.value.NumericValue |
---|
arithmetic, ceiling, compareTo, compareTo, equals, floor, getDecimalValue, getDoubleValue, getFloatValue, getXPathComparable, hashCode, isInteger, isNaN, longValue, negate, parseNumber, promote, round, roundHalfToEven, signum, toString |
Methods inherited from class net.sf.saxon.value.AtomicValue |
---|
checkPermittedContents, convert, convert, convertPrimitive, copy, effectiveBooleanValue, getCardinality, getComponent, getItemType, getLength, getStringValue, getStringValueCS, getTypedValue, getTypeLabel, hasBuiltInType, isMultiValued, itemAt, iterate, process, setTypeLabel |
Methods inherited from class net.sf.saxon.value.Value |
---|
asItem, asItem, asIterator, asValue, convert, convertJavaObjectToXPath, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Int64Value MINUS_ONE
public static final Int64Value ZERO
public static final Int64Value PLUS_ONE
public static final Int64Value[] SMALL_INTEGERS
public static final Int64Value MAX_LONG
public static final Int64Value MIN_LONG
Constructor Detail |
---|
public IntegerValue()
Method Detail |
---|
public static IntegerValue makeIntegerValue(BigInteger value)
public abstract ValidationException convertToSubType(AtomicType type, boolean validate)
type
- the subtype of integer required
public static boolean checkRange(long value, AtomicType type)
value
- the value to be checkedtype
- the required item type, a subtype of xs:integer
public static boolean checkBigRange(BigInteger big, AtomicType type)
public static AtomicValue stringToInteger(CharSequence s)
s
- CharSequence representing the string to be converted
public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public boolean isWholeNumber()
isWholeNumber
in class NumericValue
public abstract IntegerValue plus(IntegerValue other)
public abstract IntegerValue minus(IntegerValue other)
public abstract IntegerValue times(IntegerValue other)
public abstract NumericValue div(IntegerValue other) throws XPathException
XPathException
- if the other integer is zeropublic abstract IntegerValue mod(IntegerValue other) throws XPathException
XPathException
- if the other integer is zeropublic abstract IntegerValue idiv(IntegerValue other) throws XPathException
XPathException
- if the other integer is zeropublic abstract BigInteger asBigInteger()
public Comparable getSchemaComparable()
getSchemaComparable
in class Value
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |