Package net.sf.saxon.ma.map
Class RangeKey
java.lang.Object
net.sf.saxon.ma.map.RangeKey
This class implements an XPath map item as a view of an XSLT key index. It is possible to specify a minimum
and maximum key value to be included in the map, and keys are returned in sorted order.
At present range keys are only available for string-valued keys using the Unicode codepoint collating sequence.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEntry
(AtomicValue key, GroundedValue value) Create a new map containing the existing entries in the map plus an additional entry, without modifying the original.boolean
conforms
(AtomicType keyType, SequenceType valueType, TypeHierarchy th) Ask whether the map conforms to a given map typeboolean
deepEquals
(Function 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 functionvoid
Output information about this function item to the diagnostic explain() outputget
(AtomicValue key) Get an entry from the MapGet a description of this function for use in error messages.Get the item type of the function itemGet the type of the map.Get the lowest common item type of the keys in the mapboolean
isEmpty()
Ask whether the map is emptyboolean
Check that result type is of the trusted system functions to return a result of the correct typekeys()
Get the set of all key values in the map.Get the set of all key-value pairs in the mapremove
(AtomicValue key) Remove an entry from the mapint
size()
Get the size of the maptoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, isStreamed, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.ma.map.MapItem
atomize, call, effectiveBooleanValue, getAnnotations, getArity, getFunctionName, getGenre, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isMap, itemAt, makeNewContext, toShortString
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
RangeKey
-
-
Method Details
-
get
Get an entry from the Map -
size
public int size()Get the size of the map -
isEmpty
public boolean isEmpty()Ask whether the map is empty -
keys
Get the set of all key values in the map. -
keyValuePairs
Get the set of all key-value pairs in the map- Specified by:
keyValuePairs
in interfaceMapItem
- Returns:
- an iterator over the key-value pairs
-
remove
Remove an entry from the map -
getKeyUType
Get the lowest common item type of the keys in the map- Specified by:
getKeyUType
in interfaceMapItem
- Returns:
- the most specific type to which all the keys belong. If the map is empty, return ErrorType.getInstance() (the type with no instances)
-
addEntry
Create a new map containing the existing entries in the map plus an additional entry, without modifying the original. If there is already an entry with the specified key, this entry is replaced by the new entry. -
conforms
Ask whether the map conforms to a given map type -
getItemType
Get the type of the map. This method is used largely for diagnostics, to report the type of a map when it differs from the required type.- Specified by:
getItemType
in interfaceMapItem
- Parameters:
th
- the type hierarchy (not used)- Returns:
- the type of this map
-
getFunctionItemType
Get the item type of the function item- Specified by:
getFunctionItemType
in interfaceFunction
- Specified by:
getFunctionItemType
in interfaceMapItem
- Returns:
- the function item's type
-
getDescription
Get a description of this function for use in error messages. For named functions, the description is the function name (as a lexical QName). For others, it might be, for example, "inline function", or "partially-applied ends-with function".- Specified by:
getDescription
in interfaceFunction
- Specified by:
getDescription
in interfaceMapItem
- Returns:
- a description of the function for use in error messages
-
deepEquals
Test whether this FunctionItem is deep-equal to another function item, under the rules of the deep-equal function- Specified by:
deepEquals
in interfaceFunction
- Specified by:
deepEquals
in interfaceMapItem
- Parameters:
other
- the other function itemcontext
- the dynamic evaluation contextcomparer
- the object to perform the comparisonflags
- options for how the comparison is performed- Returns:
- true if the two function items are deep-equal
-
export
Output information about this function item to the diagnostic explain() output- Specified by:
export
in interfaceFunction
- Specified by:
export
in interfaceMapItem
- Throws:
XPathException
-
isTrustedResultType
public boolean isTrustedResultType()Description copied from interface:Function
Check that result type is of the trusted system functions to return a result of the correct type- Specified by:
isTrustedResultType
in interfaceFunction
- Specified by:
isTrustedResultType
in interfaceMapItem
-
toString
-