Package org.infinispan.commons.util
Class ForwardingList<E>
- java.lang.Object
-
- org.infinispan.commons.util.ForwardingList<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>
- Direct Known Subclasses:
EnumerationList
public abstract class ForwardingList<E> extends Object implements List<E>
A list which forwards all its method calls to another list. Subclasses should override one or more methods to modify the behavior of the backing list as desired per the decorator pattern.This class does not implement
RandomAccess. If the delegate supports random access, theForwardingListsubclass should implement theRandomAccessinterface.- Since:
- 2 (imported from Google Collections Library)
- Author:
- Mike Bostock
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForwardingList()Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int index, E element)booleanadd(E element)booleanaddAll(int index, Collection<? extends E> elements)booleanaddAll(Collection<? extends E> collection)voidclear()booleancontains(Object object)booleancontainsAll(Collection<?> collection)protected abstract List<E>delegate()booleanequals(Object object)Eget(int index)inthashCode()intindexOf(Object element)booleanisEmpty()Iterator<E>iterator()intlastIndexOf(Object element)ListIterator<E>listIterator()ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(Object object)booleanremoveAll(Collection<?> collection)booleanretainAll(Collection<?> collection)Eset(int index, E element)intsize()List<E>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] array)
-
-
-
Method Detail
-
add
public void add(int index, E element)
-
addAll
public boolean addAll(int index, Collection<? extends E> elements)
-
get
public E get(int index)
-
indexOf
public int indexOf(Object element)
-
lastIndexOf
public int lastIndexOf(Object element)
-
listIterator
public ListIterator<E> listIterator()
-
listIterator
public ListIterator<E> listIterator(int index)
-
remove
public E remove(int index)
-
equals
public boolean equals(Object object)
-
hashCode
public int hashCode()
-
size
public int size()
-
removeAll
public boolean removeAll(Collection<?> collection)
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object object)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
add
public boolean add(E element)
-
remove
public boolean remove(Object object)
-
containsAll
public boolean containsAll(Collection<?> collection)
-
addAll
public boolean addAll(Collection<? extends E> collection)
-
retainAll
public boolean retainAll(Collection<?> collection)
-
clear
public void clear()
-
-