Package net.sf.saxon.ma.trie
Class ImmutableHashTrieMap<K,V>
- java.lang.Object
-
- net.sf.saxon.ma.trie.ImmutableHashTrieMap<K,V>
-
- All Implemented Interfaces:
Iterable<TrieKVP<K,V>>
,ImmutableMap<K,V>
public abstract class ImmutableHashTrieMap<K,V> extends Object implements ImmutableMap<K,V>, Iterable<TrieKVP<K,V>>
-
-
Constructor Summary
Constructors Constructor Description ImmutableHashTrieMap()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <K,V>
ImmutableHashTrieMap<K,V>empty()
(package private) abstract V
get(int shift, K key)
V
get(K key)
Retrieve a stored value from the map based on the key for the associated entry.(package private) abstract boolean
isArrayNode()
(package private) abstract ImmutableHashTrieMap<K,V>
put(int shift, K key, V value)
ImmutableHashTrieMap<K,V>
put(K key, V value)
Add a new entry to the map.(package private) abstract ImmutableHashTrieMap<K,V>
remove(int shift, K key)
ImmutableHashTrieMap<K,V>
remove(K key)
Remove an entry from the map.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.ma.trie.ImmutableMap
iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
empty
public static <K,V> ImmutableHashTrieMap<K,V> empty()
-
put
public ImmutableHashTrieMap<K,V> put(K key, V value)
Description copied from interface:ImmutableMap
Add a new entry to the map. If an entry already exists with the given key, the returned map will contain this entry, but not the existing entry.- Specified by:
put
in interfaceImmutableMap<K,V>
- Parameters:
key
- the key to use to retrieve this itemvalue
- the value stored for this item- Returns:
- a new map with this item added
-
remove
public ImmutableHashTrieMap<K,V> remove(K key)
Description copied from interface:ImmutableMap
Remove an entry from the map. If no entry exists with the given key, the returned map will have identical contents to the original map (and may, in fact, be the original map itself).- Specified by:
remove
in interfaceImmutableMap<K,V>
- Parameters:
key
- the key for the entry to remove- Returns:
- a new map with the entry with the given key removed (or a map with the original contents if no entry was found for the given key).
-
get
public V get(K key)
Description copied from interface:ImmutableMap
Retrieve a stored value from the map based on the key for the associated entry. If no entry exists with the given key, we return None.- Specified by:
get
in interfaceImmutableMap<K,V>
- Parameters:
key
- the key for the entry to retrieve- Returns:
- Some(value) if an entry exists with the given key, or None if no entry with the given key was found.
-
put
abstract ImmutableHashTrieMap<K,V> put(int shift, K key, V value)
-
remove
abstract ImmutableHashTrieMap<K,V> remove(int shift, K key)
-
isArrayNode
abstract boolean isArrayNode()
-
-