public class ArrayAdapter<T> extends Object implements Sequence<T>, Serializable
Sequence
interface that wraps an array.Sequence.Tree<T>
Constructor and Description |
---|
ArrayAdapter(T... array) |
Modifier and Type | Method and Description |
---|---|
int |
add(T item)
Adds an item to the sequence.
|
T |
get(int index)
Retrieves the item at the given index.
|
int |
getLength()
Returns the length of the sequence.
|
int |
indexOf(T item)
Returns the index of an item in the sequence.
|
void |
insert(T item,
int index)
Inserts an item into the sequence at a specific index.
|
Sequence<T> |
remove(int index,
int count)
Removes one or more items from the sequence.
|
int |
remove(T item)
Removes the first occurrence of the given item from the sequence.
|
T |
update(int index,
T item)
Updates the item at the given index.
|
public ArrayAdapter(T... array)
public int add(T item)
Sequence
public void insert(T item, int index)
Sequence
public T update(int index, T item)
Sequence
public int remove(T item)
Sequence
remove
in interface Sequence<T>
item
- The item to remove.Sequence.remove(int, int)
public Sequence<T> remove(int index, int count)
Sequence
public T get(int index)
Sequence
public int indexOf(T item)
Sequence