ImmutableArray2

An immutable array.

Methods
static ImmutableArray2 create(K... array)
Create an immutable array.
static ImmutableArray2 create(K... array)
Create an immutable array.
Parameters:
array - the data
Returns:
the new immutable array
static ImmutableArray2 empty()
Get an empty immutable array.
static ImmutableArray2 empty()
Get an empty immutable array.
Returns:
the array
K[] array()
Get the data.
K[] array()
Get the data.
Returns:
the data
K get(int index)
Get the entry at this index.
K get(int index)
Get the entry at this index.
Parameters:
index - the index
Returns:
the entry
ImmutableArray2 insert(int index, K obj)
Insert an entry at this index.
ImmutableArray2 insert(int index, K obj)
Insert an entry at this index.
Parameters:
index - the index
obj - the object
Returns:
the new immutable array
Iterator iterator()
Get an iterator over all entries.
Iterator iterator()
Get an iterator over all entries.
Returns:
the iterator
int length()
Get the length.
int length()
Get the length.
Returns:
the length
ImmutableArray2 remove(int index)
Remove the entry at this index.
ImmutableArray2 remove(int index)
Remove the entry at this index.
Parameters:
index - the index
Returns:
the new immutable array
ImmutableArray2 set(int index, K obj)
Set the entry at this index.
ImmutableArray2 set(int index, K obj)
Set the entry at this index.
Parameters:
index - the index
obj - the object
Returns:
the new immutable array
ImmutableArray2 subArray(int fromIndex, int toIndex)
Get a sub-array.
ImmutableArray2 subArray(int fromIndex, int toIndex)
Get a sub-array.
Parameters:
fromIndex - the index of the first entry
toIndex - the end index, plus one
Returns:
the new immutable array
String toString()
String toString()