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 TypeMethodDescriptionvoid
checkInvariants
(ArraySizeMapper<T> mapper) delete
(int index) static <T> TrieArrayNode
<T> empty()
entries()
find
(int index) void
forEach
(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) boolean
isEmpty()
keys()
<K,
V> TrieArrayNode <T> mappedAssign
(ArrayAssignMapper<K, V, T> mapper, K key, V value) <K> boolean
mappedContains
(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) int
size()
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()
-