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, theForwardingList
subclass should implement theRandomAccess
interface.- Since:
- 2 (imported from Google Collections Library)
- Author:
- Mike Bostock
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForwardingList()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(int index, E element)
boolean
add(E element)
boolean
addAll(int index, Collection<? extends E> elements)
boolean
addAll(Collection<? extends E> collection)
void
clear()
boolean
contains(Object object)
boolean
containsAll(Collection<?> collection)
protected abstract List<E>
delegate()
boolean
equals(Object object)
E
get(int index)
int
hashCode()
int
indexOf(Object element)
boolean
isEmpty()
Iterator<E>
iterator()
int
lastIndexOf(Object element)
ListIterator<E>
listIterator()
ListIterator<E>
listIterator(int index)
E
remove(int index)
boolean
remove(Object object)
boolean
removeAll(Collection<?> collection)
boolean
retainAll(Collection<?> collection)
E
set(int index, E element)
int
size()
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()
-
-