org.omnaest.utils.structure.collection.list
Class ListAbstract<E>

java.lang.Object
  extended by org.omnaest.utils.structure.collection.CollectionAbstract<E>
      extended by org.omnaest.utils.structure.collection.list.ListAbstract<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>
Direct Known Subclasses:
IdentityArrayList, TableToTypeListAdapter

public abstract class ListAbstract<E>
extends CollectionAbstract<E>
implements List<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.

Author:
Omnaest
See Also:
List, MapAbstract, CollectionAbstract, Serialized Form

Constructor Summary
ListAbstract()
           
ListAbstract(Collection<E> collection)
           
 
Method Summary
 boolean addAll(int index, Collection<? extends E> elementCollection)
           
 boolean contains(Object o)
           
protected  boolean isValidIndex(int index)
           
 Iterator<E> iterator()
           
 ListIterator<E> listIterator()
           
 ListIterator<E> listIterator(int index)
           
 boolean remove(Object o)
           
 List<E> subList(int fromIndex, int toIndex)
           
 
Methods inherited from class org.omnaest.utils.structure.collection.CollectionAbstract
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, clear, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, remove, removeAll, retainAll, set, size, toArray, toArray
 

Constructor Detail

ListAbstract

public ListAbstract(Collection<E> collection)
Parameters:
collection -

ListAbstract

public ListAbstract()
Method Detail

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 List<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<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 List<E>


Copyright © 2011. All Rights Reserved.