Class AbstractListDecorator<E>
- java.lang.Object
-
- org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
-
- org.apache.commons.collections4.list.AbstractListDecorator<E>
-
- Type Parameters:
E- the type of the elements in the list
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>
- Direct Known Subclasses:
AbstractSerializableListDecorator
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E> implements java.util.List<E>
Decorates anotherListto provide additional behaviour.Methods are forwarded directly to the decorated list.
- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractListDecorator()Constructor only used in deserialization, do not use otherwise.protectedAbstractListDecorator(java.util.List<E> list)Constructor that wraps (not copies).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, E object)booleanaddAll(int index, java.util.Collection<? extends E> coll)protected java.util.List<E>decorated()Gets the list being decorated.booleanequals(java.lang.Object object)Eget(int index)inthashCode()intindexOf(java.lang.Object object)intlastIndexOf(java.lang.Object object)java.util.ListIterator<E>listIterator()java.util.ListIterator<E>listIterator(int index)Eremove(int index)Eset(int index, E object)java.util.List<E>subList(int fromIndex, int toIndex)-
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, setCollection, size, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
AbstractListDecorator
protected AbstractListDecorator()
Constructor only used in deserialization, do not use otherwise.- Since:
- 3.1
-
AbstractListDecorator
protected AbstractListDecorator(java.util.List<E> list)
Constructor that wraps (not copies).- Parameters:
list- the list to decorate, must not be null- Throws:
java.lang.NullPointerException- if list is null
-
-
Method Detail
-
decorated
protected java.util.List<E> decorated()
Gets the list being decorated.- Overrides:
decoratedin classAbstractCollectionDecorator<E>- Returns:
- the decorated list
-
equals
public boolean equals(java.lang.Object object)
-
hashCode
public int hashCode()
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> coll)- Specified by:
addAllin interfacejava.util.List<E>
-
indexOf
public int indexOf(java.lang.Object object)
- Specified by:
indexOfin interfacejava.util.List<E>
-
lastIndexOf
public int lastIndexOf(java.lang.Object object)
- Specified by:
lastIndexOfin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<E>
-
-