K - the typepublic abstract class ImmutableArray3<K>
extends java.lang.Object
implements java.lang.Iterable<K>
| Constructor and Description |
|---|
ImmutableArray3() |
| Modifier and Type | Method and Description |
|---|---|
K[] |
array()
Get the data.
|
static <K> ImmutableArray3<K> |
create(K... array)
Create an immutable array.
|
static <K> ImmutableArray3<K> |
empty()
Get an empty immutable array.
|
abstract K |
get(int index)
Get the entry at this index.
|
abstract ImmutableArray3<K> |
insert(int index,
K obj)
Insert an entry at this index.
|
java.util.Iterator<K> |
iterator()
Get an iterator over all entries.
|
abstract int |
length()
Get the length.
|
abstract ImmutableArray3<K> |
remove(int index)
Remove the entry at this index.
|
abstract ImmutableArray3<K> |
set(int index,
K obj)
Set the entry at this index.
|
ImmutableArray3<K> |
subArray(int fromIndex,
int toIndex)
Get a sub-array.
|
java.lang.String |
toString() |
public abstract int length()
public abstract K get(int index)
index - the indexpublic abstract ImmutableArray3<K> set(int index, K obj)
index - the indexobj - the objectpublic abstract ImmutableArray3<K> insert(int index, K obj)
index - the indexobj - the objectpublic abstract ImmutableArray3<K> remove(int index)
index - the indexpublic ImmutableArray3<K> subArray(int fromIndex, int toIndex)
fromIndex - the index of the first entrytoIndex - the end index, plus one@SafeVarargs public static <K> ImmutableArray3<K> create(K... array)
array - the datapublic K[] array()
public java.lang.String toString()
toString in class java.lang.Objectpublic static <K> ImmutableArray3<K> empty()
K - the key type