org.omnaest.utils.structure.array
Class ArrayToListAdapter<E>
java.lang.Object
org.omnaest.utils.structure.collection.CollectionAbstract<E>
org.omnaest.utils.structure.collection.list.ListAbstract<E>
org.omnaest.utils.structure.array.ArrayToListAdapter<E>
- Type Parameters:
E -
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, Deque<E>, List<E>, Queue<E>
public class ArrayToListAdapter<E>
- extends ListAbstract<E>
Adapter to use an Array instance as List. Any changes to the adapter will be reflected to the Array and
vice versa.
Due to the immutable length of an Array any invocations of methods which change the size will throw an
UnsupportedOperationException.
- Author:
- Omnaest
- See Also:
Array,
List,
Serialized Form
|
Field Summary |
protected E[] |
array
|
| Methods inherited from class org.omnaest.utils.structure.collection.list.ListAbstract |
addAll, addFirst, addLast, clear, contains, descendingIterator, element, getFirst, getLast, isValidIndex, iterator, listIterator, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, subList |
array
protected final E[] array
ArrayToListAdapter
public ArrayToListAdapter(E[] array)
- Parameters:
array - - See Also:
ArrayToListAdapter
size
public int size()
add
public boolean add(E e)
get
public E get(int index)
set
public E set(int index,
E element)
add
public void add(int index,
E element)
remove
public E remove(int index)
indexOf
public int indexOf(Object o)
lastIndexOf
public int lastIndexOf(Object o)
Copyright © 2013. All Rights Reserved.