public class RangeKey extends Object implements MapItem
At present range keys are only available for string-valued keys using the Unicode codepoint collating sequence.
| Constructor and Description |
|---|
RangeKey(String min,
String max,
TreeMap<String,List<NodeInfo>> index) |
| Modifier and Type | Method and Description |
|---|---|
Sequence |
call(XPathContext context,
Sequence[] args)
Invoke the function
|
boolean |
deepEquals(FunctionItem other,
XPathContext context,
AtomicComparer comparer,
int flags)
Test whether this FunctionItem is deep-equal to another function item,
under the rules of the deep-equal function
|
boolean |
effectiveBooleanValue()
Get the effective boolean value of this sequence
|
Sequence |
get(AtomicValue key,
XPathContext context)
Get an entry from the Map
|
int |
getArity()
Get the arity of the function
|
StringCollator |
getCollation()
Get the collation of the map
|
String |
getCollationName()
Get the name of the collation of the map
|
MapType |
getFunctionItemType(TypeHierarchy th)
Get the item type of the function item
|
StructuredQName |
getFunctionName()
Get the name of the function, or null if it is anonymous
|
AtomicType |
getKeyType(TypeHierarchy th)
Get the lowest common item type of the keys in the map
|
int |
getLength()
Get the size of the value (the number of items)
|
String |
getStringValue()
Get the value of the item as a string.
|
CharSequence |
getStringValueCS()
Get the string value of the item as a CharSequence.
|
SequenceType |
getValueType(TypeHierarchy th)
Get the lowest common sequence type of all the values in the map
|
Item |
head()
Get the first item in the sequence.
|
boolean |
isEmpty()
Ask whether the map is empty
|
Item |
itemAt(int n)
Get the n'th item in the value, counting from 0
|
SequenceIterator |
iterate()
Get an iterator over all the items in the sequence
|
UnfailingIterator<StringValue> |
keys()
Get the set of all key values in the map.
|
GroundedValue |
reduce()
Reduce the sequence to its simplest form.
|
MapItem |
remove(AtomicValue key,
XPathContext context)
Remove an entry from the map
|
int |
size()
Get the size of the map
|
GroundedValue |
subsequence(int start,
int length)
Get a subsequence of the value
|
public RangeKey(String min, String max, TreeMap<String,List<NodeInfo>> index) throws XPathException
XPathExceptionpublic String getCollationName()
getCollationName in interface MapItempublic StringCollator getCollation()
getCollation in interface MapItempublic Sequence get(AtomicValue key, XPathContext context) throws XPathException
get in interface MapItemkey - the value of the keycontext - the XPath dynamic evaluation contextXPathException - if a dynamic error occurspublic int size()
public boolean isEmpty()
public UnfailingIterator<StringValue> keys()
public MapItem remove(AtomicValue key, XPathContext context) throws XPathException
remove in interface MapItemkey - the key of the entry to be removedcontext - the XPath dynamic contextXPathException - if a dynamic error occurspublic AtomicType getKeyType(TypeHierarchy th)
getKeyType in interface MapItemth - the type hierarchypublic SequenceType getValueType(TypeHierarchy th)
getValueType in interface MapItemth - the type hierarchypublic MapType getFunctionItemType(TypeHierarchy th)
getFunctionItemType in interface FunctionItemth - the type hierarchy cachepublic StructuredQName getFunctionName()
getFunctionName in interface FunctionItempublic int getArity()
getArity in interface FunctionItempublic Sequence call(XPathContext context, Sequence[] args) throws XPathException
call in interface Callablecall in interface FunctionItemcontext - the XPath dynamic evaluation contextargs - the actual arguments to be suppliedXPathException - if a dynamic error occurs within the functionpublic boolean deepEquals(FunctionItem other, XPathContext context, AtomicComparer comparer, int flags) throws XPathException
deepEquals in interface FunctionItemother - the other function itemcontext - the dynamic evaluation contextcomparer - the object to perform the comparisonflags - options for how the comparison is performedXPathException - if the comparison cannot be performedpublic Item itemAt(int n)
itemAt in interface GroundedValuen - the index of the required item, with 0 representing the first item in the sequencepublic GroundedValue subsequence(int start, int length)
subsequence in interface GroundedValuestart - the index of the first item to be included in the result, counting from zero.
A negative value is taken as zero. If the value is beyond the end of the sequence, an empty
sequence is returnedlength - the number of items to be included in the result. Specify Integer.MAX_VALUE to
get the subsequence up to the end of the base sequence. If the value is negative, an empty sequence
is returned. If the value goes off the end of the sequence, the result returns items up to the end
of the sequencepublic int getLength()
getLength in interface GroundedValuepublic boolean effectiveBooleanValue()
throws XPathException
effectiveBooleanValue in interface GroundedValueXPathException - if the sequence has no effective boolean value (for example a sequence of two integers)public GroundedValue reduce()
reduce in interface GroundedValuepublic String getStringValue()
getStringValueCS() should
be used. If the caller requires a string, this method is preferred.getStringValue in interface GroundedValuegetStringValue in interface ItemUnsupportedOperationException - if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValueCS()public CharSequence getStringValueCS()
X.getStringValueCS().toString() returns a string that is equal to
X.getStringValue().
Note that two CharSequence values of different types should not be compared using equals(), and
for the same reason they should not be used as a key in a hash table.
If the calling code can handle any CharSequence, this method should
be used. If the caller requires a string, the getStringValue() method is preferred.getStringValueCS in interface GroundedValuegetStringValueCS in interface ItemUnsupportedOperationException - if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValue()public Item head() throws XPathException
head in interface SequenceXPathException - in the situation where the sequence is evaluated lazily, and
evaluation of the first item causes a dynamic error.public SequenceIterator iterate() throws XPathException
iterate in interface SequenceXPathException - in the situation where the sequence is evaluated lazily, and
constructing an iterator over the items causes a dynamic error.Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.