Package net.sf.saxon.ma.map
Class FixedMapWithStringKeys
java.lang.Object
net.sf.saxon.ma.MapOrArray
net.sf.saxon.ma.map.MapItem
net.sf.saxon.ma.map.MapWithTypeCache
net.sf.saxon.ma.map.AbstractFixedMap
net.sf.saxon.ma.map.FixedMapWithStringKeys
- All Implemented Interfaces:
Iterable<KeyValuePair>,Callable,FunctionItem,GroundedValue,Item,Sequence
A variant of the
FixedMap map implementation optimized for the case where
the keys are all instances of xs:string. This saves space because it avoids
the need (a) to wrap the UnicodeString values in a StringValue, and (b)
to store a type annotation (as this is always xs:string-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.saxon.ma.map.MapItem
MapItem.KeyIterator -
Field Summary
Fields inherited from class net.sf.saxon.ma.map.AbstractFixedMap
index, valuesFields inherited from class net.sf.saxon.ma.map.MapWithTypeCache
knownKeyType, knownValueTypeFields inherited from class net.sf.saxon.ma.map.MapItem
mapConstructorDuplicatesAction, xslMapDuplicatesAction, xslRecordDuplicatesAction -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFixedMapWithStringKeys(UnicodeString[] keys, GroundedValue[] values, int specVersion, HashMap<AtomicMatchKey, Integer> index) Construct aFixedMapsupplying the entries as an array of keys and a corresponding array of value. -
Method Summary
Modifier and TypeMethodDescriptionstatic FixedMapWithStringKeysprotected AtomicValuegetKey(int position) Get the key at a given offset.getU(UnicodeString key) Get an entry from the map, supplying aUnicodeStringas the keyMethods inherited from class net.sf.saxon.ma.map.AbstractFixedMap
ensureIndexed, get, getBuilder, getOffset, getPosition, getValue, iterator, keyValuePairs, put, putOffsetIfAbsent, remove, size, toStringMethods inherited from class net.sf.saxon.ma.map.MapWithTypeCache
conforms, setKnownTypeMethods inherited from class net.sf.saxon.ma.map.MapItem
atomize, call, deepEqual40, deepEquals, effectiveBooleanValue, entries, export, followingKeyValuePairs, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getItemType, getItemTypeOfSequence, getOperandRoles, getSpecVersion, getTypedValue, getUnicodeStringValue, getWithPlan, isArray, isEmpty, isKnownToConform, isMap, isTrustedResultType, itemAt, keys, makeNewContext, mapToString, precedingKeyValuePairs, setSpecVersion, toShortStringMethods inherited from class net.sf.saxon.ma.MapOrArray
obtainRootJNodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.FunctionItem
isSequenceVariadicMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, getStringValue, head, isStreamed, iterate, reduce, subsequenceMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
FixedMapWithStringKeys
protected FixedMapWithStringKeys(UnicodeString[] keys, GroundedValue[] values, int specVersion, HashMap<AtomicMatchKey, Integer> index) Construct aFixedMapsupplying the entries as an array of keys and a corresponding array of value. The caller is responsible for ensuring that there are no duplicate keys. The two arrays (of keys and values) must have the same length. The content of the arrays must not be subsequently modified.- Parameters:
keys- an array of keysvalues- a corresponding array of valuesindex- a hash map indexing the values
-
-
Method Details
-
getKey
Description copied from class:AbstractFixedMapGet the key at a given offset. This method is provided for use by subclasses, which can store the actual key in different ways.- Specified by:
getKeyin classAbstractFixedMap- Parameters:
position- the offset (sibling position within the ordered map) of the required key- Returns:
- the key at the specified position
-
fromJavaMap
-
getU
Get an entry from the map, supplying aUnicodeStringas the key
-