public final class HashArrayMappedTrie<K,V>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BITS_IN_INDEX |
static int |
MAX_INDEX |
static int |
MIN_INDEX |
static int |
SIZE |
Modifier and Type | Method and Description |
---|---|
static <K,V> HashArrayMappedTrie<K,V> |
empty(Equal<K> e,
Hash<K> h)
Creates an empty trie.
|
static <V> HashArrayMappedTrie<java.lang.Integer,V> |
emptyKeyInteger()
Create and empty trie keyed by integer.
|
Option<V> |
find(K k)
Returns an optional value for the given key k.
|
Option<V> |
find(K k,
int lowIndex,
int highIndex)
Returns an optional value for the given key k for those nodes between
lowIndex (inclusive) and highIndex (exclusive).
|
<B> B |
foldLeft(F2<B,P2<K,V>,B> f,
B b)
Performs a left-fold reduction across this trie.
|
<B> B |
foldLeft(F2<B,P2<K,V>,B> f,
F2<B,HashArrayMappedTrie<K,V>,B> g,
B b)
Performs a left-fold reduction across this trie.
|
<B> B |
foldLeftOnNode(F2<B,Node<K,V>,B> f,
B b)
Performs a left-fold reduction across this trie.
|
BitSet |
getBitSet() |
Seq<Node<K,V>> |
getSeq() |
boolean |
isEmpty()
Returns if the trie is empty.
|
int |
length()
Returns the number of elements in the trie.
|
HashArrayMappedTrie<K,V> |
set(K k,
V v)
Adds the key-value pair (k, v) to the trie.
|
HashArrayMappedTrie<K,V> |
set(List<P2<K,V>> list)
Adds the product of key-value (k, v) pairs to the trie.
|
List<P2<K,V>> |
toList()
Returns a list of key-value pairs.
|
List<P2<K,V>> |
toList(Ord<K> o)
Returns the list of key-value pairs, ordered by key.
|
Stream<P2<K,V>> |
toStream()
Returns a stream of key-value pairs.
|
java.lang.String |
toString() |
public static final int BITS_IN_INDEX
public static final int SIZE
public static final int MIN_INDEX
public static final int MAX_INDEX
public static <K,V> HashArrayMappedTrie<K,V> empty(Equal<K> e, Hash<K> h)
public static <V> HashArrayMappedTrie<java.lang.Integer,V> emptyKeyInteger()
public boolean isEmpty()
public Option<V> find(K k, int lowIndex, int highIndex)
public HashArrayMappedTrie<K,V> set(K k, V v)
public HashArrayMappedTrie<K,V> set(List<P2<K,V>> list)
public java.lang.String toString()
toString
in class java.lang.Object
public <B> B foldLeftOnNode(F2<B,Node<K,V>,B> f, B b)
public <B> B foldLeft(F2<B,P2<K,V>,B> f, F2<B,HashArrayMappedTrie<K,V>,B> g, B b)
public <B> B foldLeft(F2<B,P2<K,V>,B> f, B b)
public BitSet getBitSet()
public int length()