org.omnaest.utils.structure.collection.list
Class ListAbstract<E>
java.lang.Object
org.omnaest.utils.structure.collection.CollectionAbstract<E>
org.omnaest.utils.structure.collection.list.ListAbstract<E>
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, Deque<E>, List<E>, Queue<E>
- Direct Known Subclasses:
- ArrayToListAdapter, IdentityArrayList, ListAbstract.ListAbstractSublist, ListToListAdapter, NestedDirectoryToByteArrayContainerListAdapter, SortedListAbstract
public abstract class ListAbstract<E>
- extends CollectionAbstract<E>
- implements List<E>, Deque<E>, Serializable
This abstract list implementation offers the basic methods like addAll, removeAll, retainAll, etc. which rely only on other
list methods and not on any underlying structure. This list offers automatic ListIterator, Iterator and sublist
which are backed to the given list.
Additionally the Deque interface is completely implemented as well.
- Author:
- Omnaest
- See Also:
List,
Deque,
CollectionAbstract,
MapAbstract,
Serialized Form
| Methods inherited from interface java.util.List |
add, add, addAll, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, remove, removeAll, retainAll, set, size, toArray, toArray |
ListAbstract
public ListAbstract()
addAll
public boolean addAll(int index,
Collection<? extends E> elementCollection)
- Specified by:
addAll in interface List<E>
isValidIndex
protected boolean isValidIndex(int index)
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIterator in interface List<E>
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIterator in interface List<E>
subList
public List<E> subList(int fromIndex,
int toIndex)
- Specified by:
subList in interface List<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in interface Deque<E>- Specified by:
iterator in interface List<E>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface Deque<E>- Specified by:
remove in interface List<E>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<E>- Specified by:
contains in interface Deque<E>- Specified by:
contains in interface List<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface List<E>- Overrides:
clear in class CollectionAbstract<E>
addFirst
public void addFirst(E element)
- Specified by:
addFirst in interface Deque<E>
addLast
public void addLast(E e)
- Specified by:
addLast in interface Deque<E>
offerFirst
public boolean offerFirst(E element)
- Specified by:
offerFirst in interface Deque<E>
offerLast
public boolean offerLast(E e)
- Specified by:
offerLast in interface Deque<E>
removeFirst
public E removeFirst()
- Specified by:
removeFirst in interface Deque<E>
removeLast
public E removeLast()
- Specified by:
removeLast in interface Deque<E>
pollFirst
public E pollFirst()
- Specified by:
pollFirst in interface Deque<E>
pollLast
public E pollLast()
- Specified by:
pollLast in interface Deque<E>
getFirst
public E getFirst()
- Specified by:
getFirst in interface Deque<E>
getLast
public E getLast()
- Specified by:
getLast in interface Deque<E>
peekFirst
public E peekFirst()
- Specified by:
peekFirst in interface Deque<E>
peekLast
public E peekLast()
- Specified by:
peekLast in interface Deque<E>
removeFirstOccurrence
public boolean removeFirstOccurrence(Object o)
- Specified by:
removeFirstOccurrence in interface Deque<E>
removeLastOccurrence
public boolean removeLastOccurrence(Object o)
- Specified by:
removeLastOccurrence in interface Deque<E>
offer
public boolean offer(E e)
- Specified by:
offer in interface Deque<E>- Specified by:
offer in interface Queue<E>
remove
public E remove()
- Specified by:
remove in interface Deque<E>- Specified by:
remove in interface Queue<E>
poll
public E poll()
- Specified by:
poll in interface Deque<E>- Specified by:
poll in interface Queue<E>
element
public E element()
- Specified by:
element in interface Deque<E>- Specified by:
element in interface Queue<E>
peek
public E peek()
- Specified by:
peek in interface Deque<E>- Specified by:
peek in interface Queue<E>
push
public void push(E element)
- Specified by:
push in interface Deque<E>
pop
public E pop()
- Specified by:
pop in interface Deque<E>
descendingIterator
public Iterator<E> descendingIterator()
- Specified by:
descendingIterator in interface Deque<E>
Copyright © 2013. All Rights Reserved.