com.saxonica.extra
Class IndexedClosure
java.lang.Object
net.sf.saxon.value.Value
net.sf.saxon.value.Closure
net.sf.saxon.value.MemoClosure
com.saxonica.extra.IndexedClosure
- All Implemented Interfaces:
- Expression, java.io.Serializable, ValueRepresentation
- public class IndexedClosure
- extends MemoClosure
A subclass of MemoClosure that allows the construction of one or more indexes to provide rapid
access to the items in the sequence
- See Also:
- Serialized Form
Methods inherited from class net.sf.saxon.value.Value |
asItem, asIterator, asValue, checkPermittedContents, collapseWhitespace, convert, convertJavaObjectToXPath, convertToJava, effectiveBooleanValue, equals, evaluateAsString, evaluateItem, getDependencies, getIterator, getParentExpression, getStringValue, hashCode, iterateSubExpressions, makeQNameValue, normalizeWhitespace, optimize, promote, schemaEquals, simplify, stringToNumber, toString, trimWhitespace, typeCheck |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
IndexedClosure
public IndexedClosure()
isIndexable
public boolean isIndexable()
- Determine wither this Closure is indexable
- Overrides:
isIndexable
in class Closure
buildIndex
public java.util.HashMap buildIndex(Expression use,
XPathContext context)
throws XPathException
- Build an index over the items in the sequence
- Parameters:
use
- the expression returning the atomic values to act as the indexing keyscontext
- dynamic context for evaluating the indexing expression
- Throws:
XPathException
findItems
public SequenceIterator findItems(Expression use,
SequenceIterator values,
XPathContext context)
throws XPathException
- Retrieve items that match a given index value
- Throws:
XPathException
materialize
public Value materialize()
throws XPathException
- Return a value containing all the items in the sequence returned by this
SequenceIterator
- Overrides:
materialize
in class MemoClosure
- Returns:
- the corresponding value
- Throws:
XPathException