ImmutableArray
An immutable array.
| Methods |
| static ImmutableArray |
create(K... array)
Create an immutable array.
|
| static ImmutableArray |
create(K... array)
Create an immutable array.
Parameters:
array - the data
Returns:
the new immutable array
|
| static ImmutableArray |
empty()
Get an empty immutable array.
|
| static ImmutableArray |
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
|
| ImmutableArray |
insert(int index, K obj)
Insert an entry at this index.
|
| ImmutableArray |
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
|
| ImmutableArray |
remove(int index)
Remove the entry at this index.
|
| ImmutableArray |
remove(int index)
Remove the entry at this index.
Parameters:
index - the index
Returns:
the new immutable array
|
| ImmutableArray |
set(int index, K obj)
Set the entry at this index.
|
| ImmutableArray |
set(int index, K obj)
Set the entry at this index.
Parameters:
index - the index
obj - the object
Returns:
the new immutable array
|
| ImmutableArray |
subArray(int fromIndex, int toIndex)
Get a sub-array.
|
| ImmutableArray |
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()
|
|