Package net.sf.saxon.ma.map
Class HashTrieMap
- java.lang.Object
- 
- net.sf.saxon.ma.map.HashTrieMap
 
- 
- 
Constructor SummaryConstructors Constructor Description HashTrieMap()Create an empty mapHashTrieMap(ImmutableMap<AtomicMatchKey,KeyValuePair> imap)Create a map whose contents are a copy of an existing immutable map
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HashTrieMapaddEntry(AtomicValue key, GroundedValue value)Create a new map containing the existing entries in the map plus an additional entry, without modifying the original.booleanconforms(AtomicType requiredKeyType, SequenceType requiredValueType, TypeHierarchy th)Ask whether the map conforms to a given map typestatic HashTrieMapcopy(MapItem map)Create a map whose entries are copies of the entries in an existing MapItemvoiddiagnosticDump()GroundedValueget(AtomicValue key)Get an entry from the MapMapTypegetItemType(TypeHierarchy th)Get the type of the map.UTypegetKeyUType()Get the lowest common item type of the keys in the mapKeyValuePairgetKeyValuePair(AtomicValue key)Get an key/value pair from the MapbooleaninitialPut(AtomicValue key, GroundedValue value)Add a new entry to this map.booleanisEmpty()Ask whether the map is emptyAtomicIterator<? extends AtomicValue>keys()Get the set of all key values in the mapjava.lang.Iterable<KeyValuePair>keyValuePairs()Get the set of all key-value pairs in the mapHashTrieMapremove(AtomicValue key)Remove an entry from the mapstatic HashTrieMapsingleton(AtomicValue key, GroundedValue value)Create a singleton map with a single key and valueintsize()Get the size of the mapjava.lang.StringtoString()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface net.sf.saxon.om.GroundedValueasIterable, concatenate, containsNode, materialize
 - 
Methods inherited from interface net.sf.saxon.om.ItemgetLength, head, isStreamed, iterate, reduce, subsequence
 - 
Methods inherited from interface net.sf.saxon.ma.map.MapItematomize, call, deepEquals, effectiveBooleanValue, export, getAnnotations, getArity, getDescription, getFunctionItemType, getFunctionName, getGenre, getOperandRoles, getStringValue, getStringValueCS, getTypedValue, isArray, isMap, isTrustedResultType, itemAt, makeNewContext, toShortString
 - 
Methods inherited from interface net.sf.saxon.om.SequencemakeRepeatable
 
- 
 
- 
- 
- 
Constructor Detail- 
HashTrieMappublic HashTrieMap() Create an empty map
 - 
HashTrieMappublic HashTrieMap(ImmutableMap<AtomicMatchKey,KeyValuePair> imap) Create a map whose contents are a copy of an existing immutable map- Parameters:
- imap- the map to be copied
 
 
- 
 - 
Method Detail- 
singletonpublic static HashTrieMap singleton(AtomicValue key, GroundedValue value) Create a singleton map with a single key and value- Parameters:
- key- the key value
- value- the associated value
- Returns:
- a singleton map
 
 - 
copypublic static HashTrieMap copy(MapItem map) Create a map whose entries are copies of the entries in an existing MapItem- Parameters:
- map- the existing map to be copied
- Returns:
- the new map
 
 - 
sizepublic int size() Get the size of the map
 - 
isEmptypublic boolean isEmpty() Ask whether the map is empty
 - 
conformspublic boolean conforms(AtomicType requiredKeyType, SequenceType requiredValueType, TypeHierarchy th) Ask whether the map conforms to a given map type
 - 
getItemTypepublic MapType getItemType(TypeHierarchy th) 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. This method has the side-effect of updating the internal type information held within the map.- Specified by:
- getItemTypein interface- MapItem
- Parameters:
- th- The type hierarchy cache for the configuration
- Returns:
- the type of this map
 
 - 
getKeyUTypepublic UType getKeyUType() Get the lowest common item type of the keys in the map- Specified by:
- getKeyUTypein interface- MapItem
- Returns:
- the most specific type to which all the keys belong. If the map is empty, return UType.VOID (the type with no instances)
 
 - 
addEntrypublic HashTrieMap addEntry(AtomicValue key, GroundedValue value) 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.
 - 
initialPutpublic boolean initialPut(AtomicValue key, GroundedValue value) Add a new entry to this map. Since the map is supposed to be immutable, this method must only be called while initially populating the map, and must not be called if anyone else might already be using the map.- Parameters:
- key- the key of the new entry. Any existing entry with this key is replaced.
- value- the value associated with the new entry
- Returns:
- true if an existing entry with the same key was replaced
 
 - 
removepublic HashTrieMap remove(AtomicValue key) Remove an entry from the map
 - 
getpublic GroundedValue get(AtomicValue key) Get an entry from the Map
 - 
getKeyValuePairpublic KeyValuePair getKeyValuePair(AtomicValue key) Get an key/value pair from the Map- Parameters:
- key- the value of the key
- Returns:
- the key-value-pair associated with the given key, or null if the key is not present in the map
 
 - 
keyspublic AtomicIterator<? extends AtomicValue> keys() Get the set of all key values in the map
 - 
keyValuePairspublic java.lang.Iterable<KeyValuePair> keyValuePairs() Get the set of all key-value pairs in the map- Specified by:
- keyValuePairsin interface- MapItem
- Returns:
- an iterable whose iterator delivers the key-value pairs
 
 - 
diagnosticDumppublic void diagnosticDump() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-