Class TrieArrayNode<T>
java.lang.Object
org.javimmutable.collections.array.TrieArrayNode<T>
Implements an array mapped trie using integers as keys. When iterating keys
are visited in signed-integer order.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckInvariants(ArraySizeMapper<T> mapper) delete(int index) static <T> TrieArrayNode<T> empty()entries()find(int index) voidforEach(IndexedProc1<T> proc) void<E extends Exception>
voidforEachThrows(IndexedProc1Throws<T, E> proc) <E extends Exception>
voidforEachThrows(Proc1Throws<T, E> proc) getValueOr(int index, T defaultValue) booleanisEmpty()keys()<K,V> TrieArrayNode <T> mappedAssign(ArrayAssignMapper<K, V, T> mapper, K key, V value) <K> booleanmappedContains(ArrayContainsMapper<K, T> mapper, K key) <K> TrieArrayNode<T> mappedDelete(ArrayDeleteMapper<K, T> mapper, K key) <K,V> GenericIterator.Iterable <IMapEntry<K, V>> mappedEntries(ArrayIterationMapper<K, V, T> mapper) <K,V> Maybe <V> mappedFind(ArrayGetMapper<K, V, T> mapper, K key) mappedFindEntry(ArrayFindEntryMapper<K, V, T> mapper, K key) <K,V> V mappedGetValueOr(ArrayGetMapper<K, V, T> mapper, K key, V defaultValue) <K> GenericIterator.Iterable<K> mappedKeys(ArrayIterationMapper<K, ?, T> mapper) <K,V> TrieArrayNode <T> mappedUpdate(ArrayUpdateMapper<K, V, T> mapper, K key, Func1<Maybe<V>, V> generator) <V> GenericIterator.Iterable<V> mappedValues(ArrayIterationMapper<?, V, T> mapper) intsize()values()
-
Method Details
-
empty
-
isEmpty
public boolean isEmpty() -
getValueOr
-
find
-
assign
-
delete
-
mappedContains
-
mappedGetValueOr
public <K,V> V mappedGetValueOr(@Nonnull ArrayGetMapper<K, V, T> mapper, @Nonnull K key, V defaultValue) -
mappedFind
-
mappedFindEntry
-
mappedAssign
@Nonnull public <K,V> TrieArrayNode<T> mappedAssign(@Nonnull ArrayAssignMapper<K, V, T> mapper, @Nonnull K key, V value) -
mappedUpdate
@Nonnull public <K,V> TrieArrayNode<T> mappedUpdate(@Nonnull ArrayUpdateMapper<K, V, T> mapper, @Nonnull K key, @Nonnull Func1<Maybe<V>, V> generator) -
mappedDelete
@Nonnull public <K> TrieArrayNode<T> mappedDelete(@Nonnull ArrayDeleteMapper<K, T> mapper, @Nonnull K key) -
forEach
-
forEachThrows
- Throws:
E
-
forEach
-
forEachThrows
- Throws:
E
-
checkInvariants
-
keys
-
values
-
entries
-
mappedKeys
@Nonnull public <K> GenericIterator.Iterable<K> mappedKeys(@Nonnull ArrayIterationMapper<K, ?, T> mapper) -
mappedValues
@Nonnull public <V> GenericIterator.Iterable<V> mappedValues(@Nonnull ArrayIterationMapper<?, V, T> mapper) -
mappedEntries
@Nonnull public <K,V> GenericIterator.Iterable<IMapEntry<K,V>> mappedEntries(@Nonnull ArrayIterationMapper<K, V, T> mapper) -
size
public int size()
-