|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javimmutable.collections.common.AbstractJImmutableArray<T>
org.javimmutable.collections.array.trie32.TrieArray<T>
@Immutable public class TrieArray<T>
Nested Class Summary | |
---|---|
static class |
TrieArray.Builder<T>
|
Method Summary | ||
---|---|---|
JImmutableArray<T> |
assign(int index,
T value)
Sets the value associated with a specific index. |
|
static
|
builder()
|
|
Cursor<JImmutableMap.Entry<Integer,T>> |
cursor()
|
|
JImmutableArray<T> |
delete(int index)
Deletes the entry for the specified index (if any). |
|
JImmutableArray<T> |
deleteAll()
|
|
Holder<T> |
find(int index)
Return a Holder containing the value associated wth the index or an empty Holder if no value is associated with the index. |
|
T |
getValueOr(int index,
T defaultValue)
Return the value associated with index or defaultValue if no value is associated. |
|
static
|
of()
|
|
static
|
of(Indexed<? extends T> source,
int offset,
int limit)
Deprecated. use builder() instead |
|
int |
size()
Return the number of entries in the map. |
Methods inherited from class org.javimmutable.collections.common.AbstractJImmutableArray |
---|
findEntry, get, getMap, insert, isEmpty, iterator, keysCursor, valuesCursor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> TrieArray.Builder<T> builder()
public static <T> TrieArray<T> of()
@Deprecated public static <T> JImmutableArray<T> of(Indexed<? extends T> source, int offset, int limit)
T
- source
- offset
- limit
-
@Nullable public T getValueOr(int index, @Nullable T defaultValue)
JImmutableArray
index
- identifies the value to retrievedefaultValue
- value to return if no entry exists for index
@Nonnull public Holder<T> find(int index)
JImmutableArray
index
- identifies the value to retrieve
@Nonnull public JImmutableArray<T> assign(int index, @Nullable T value)
JImmutableArray
index
- indexvalue
- possibly null value
@Nonnull public JImmutableArray<T> delete(int index)
JImmutableArray
index
- index
public int size()
JImmutableArray
@Nonnull public JImmutableArray<T> deleteAll()
@Nonnull public Cursor<JImmutableMap.Entry<Integer,T>> cursor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |