Package net.sf.saxon.value
Class IntegerRange
java.lang.Object
net.sf.saxon.value.Value
net.sf.saxon.value.IntegerRange
- All Implemented Interfaces:
Serializable
,Expression
,ValueRepresentation
This class represents a sequence of consecutive ascending integers, for example 1 to 50.
The integers must be within the range of a Java long.
- See Also:
-
Field Summary
FieldsFields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
display
(int level, PrintStream out, Configuration config) Diagnostic display of the expressionint
Determine the cardinalitylong
getEnd()
int
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().Determine the data type of the items in the expression, if possibleint
Get the length of the sequencelong
getStart()
itemAt
(int n) Get the n'th item in the sequence (starting from 0).iterate
(XPathContext context) Return an Iterator to iterate over the values of a sequence.Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, checkPermittedContents, convert, convertJavaObjectToXPath, convertToJava, effectiveBooleanValue, equals, evaluateAsString, evaluateItem, getDependencies, getIterator, getParentExpression, getSpecialProperties, getStringValue, getStringValueCS, hashCode, iterateSubExpressions, makeQNameValue, optimize, process, promote, reduce, simplify, stringToNumber, toString, typeCheck
-
Field Details
-
start
public long start -
end
public long end
-
-
Constructor Details
-
IntegerRange
public IntegerRange(long start, long end)
-
-
Method Details
-
getStart
public long getStart() -
getEnd
public long getEnd() -
getImplementationMethod
public int getImplementationMethod()An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is provided directly. The other methods will always be available indirectly, using an implementation that relies on one of the other methods. -
iterate
Return an Iterator to iterate over the values of a sequence. The value of every expression can be regarded as a sequence, so this method is supported for all expressions. This default implementation handles iteration for expressions that return singleton values: for non-singleton expressions, the subclass must provide its own implementation.- Parameters:
context
- supplies the context for evaluation- Returns:
- a SequenceIterator that can be used to iterate over the result of the expression
- Throws:
XPathException
- if any dynamic error occurs evaluating the expression
-
getItemType
Determine the data type of the items in the expression, if possible- Specified by:
getItemType
in interfaceExpression
- Overrides:
getItemType
in classValue
- Parameters:
th
-- Returns:
- AnyItemType (not known)
-
getCardinality
public int getCardinality()Determine the cardinality- Specified by:
getCardinality
in interfaceExpression
- Overrides:
getCardinality
in classValue
- Returns:
- one of the values
StaticProperty.ALLOWS_ONE
,StaticProperty.ALLOWS_ZERO_OR_MORE
,StaticProperty.ALLOWS_ZERO_OR_ONE
,StaticProperty.ALLOWS_ONE_OR_MORE
,StaticProperty.EMPTY
. This default implementation returns ZERO_OR_MORE (which effectively gives no information).
-
itemAt
Get the n'th item in the sequence (starting from 0). This is defined for all Values, but its real benefits come for a sequence Value stored extensionally (or for a MemoClosure, once all the values have been read)- Overrides:
itemAt
in classValue
- Throws:
XPathException
-
getLength
Get the length of the sequence- Overrides:
getLength
in classValue
- Throws:
XPathException
-
display
Diagnostic display of the expression- Specified by:
display
in interfaceExpression
- Overrides:
display
in classValue
- Parameters:
level
- indentation level for this expressionout
- Output destinationconfig
-
-