Package io.vavr.collection
Class HashArrayMappedTrieModule.LeafSingleton<K,V>
- java.lang.Object
-
- io.vavr.collection.HashArrayMappedTrieModule.AbstractNode<K,V>
-
- io.vavr.collection.HashArrayMappedTrieModule.LeafNode<K,V>
-
- io.vavr.collection.HashArrayMappedTrieModule.LeafSingleton<K,V>
-
- Type Parameters:
K- Key typeV- Value type
- All Implemented Interfaces:
HashArrayMappedTrie<K,V>,java.io.Serializable,java.lang.Iterable<Tuple2<K,V>>
- Enclosing interface:
- HashArrayMappedTrieModule
public static final class HashArrayMappedTrieModule.LeafSingleton<K,V> extends HashArrayMappedTrieModule.LeafNode<K,V> implements java.io.Serializable
Representation of a HAMT leaf node with single element.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private inthashprivate Kkeyprivate static longserialVersionUIDprivate Vvalue-
Fields inherited from class io.vavr.collection.HashArrayMappedTrieModule.AbstractNode
BUCKET_SIZE, MAX_INDEX_NODE, MIN_ARRAY_NODE, SIZE
-
-
Constructor Summary
Constructors Constructor Description LeafSingleton(int hash, K key, V value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanequals(int keyHash, K key)(package private) inthash()(package private) Kkey()(package private) Option<V>lookup(int shift, int keyHash, K key)(package private) Vlookup(int shift, int keyHash, K key, V defaultValue)(package private) HashArrayMappedTrieModule.AbstractNode<K,V>modify(int shift, int keyHash, K key, V value, HashArrayMappedTrieModule.Action action)Iterator<HashArrayMappedTrieModule.LeafNode<K,V>>nodes()intsize()(package private) Vvalue()-
Methods inherited from class io.vavr.collection.HashArrayMappedTrieModule.LeafNode
isEmpty, mergeLeaves
-
Methods inherited from class io.vavr.collection.HashArrayMappedTrieModule.AbstractNode
containsKey, fromBitmap, get, getOrElse, hashFragment, insert, iterator, keysIterator, put, remove, remove, toBitmap, toString, update, valuesIterator
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
hash
private final int hash
-
key
private final K key
-
value
private final V value
-
-
Method Detail
-
equals
private boolean equals(int keyHash, K key)
-
lookup
Option<V> lookup(int shift, int keyHash, K key)
- Specified by:
lookupin classHashArrayMappedTrieModule.AbstractNode<K,V>
-
lookup
V lookup(int shift, int keyHash, K key, V defaultValue)
- Specified by:
lookupin classHashArrayMappedTrieModule.AbstractNode<K,V>
-
modify
HashArrayMappedTrieModule.AbstractNode<K,V> modify(int shift, int keyHash, K key, V value, HashArrayMappedTrieModule.Action action)
- Specified by:
modifyin classHashArrayMappedTrieModule.AbstractNode<K,V>
-
size
public int size()
- Specified by:
sizein interfaceHashArrayMappedTrie<K,V>
-
nodes
public Iterator<HashArrayMappedTrieModule.LeafNode<K,V>> nodes()
- Overrides:
nodesin classHashArrayMappedTrieModule.AbstractNode<K,V>
-
hash
int hash()
- Specified by:
hashin classHashArrayMappedTrieModule.LeafNode<K,V>
-
key
K key()
- Specified by:
keyin classHashArrayMappedTrieModule.LeafNode<K,V>
-
value
V value()
- Specified by:
valuein classHashArrayMappedTrieModule.LeafNode<K,V>
-
-