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)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
addAll
public boolean addAll(int index, Collection<? extends E> elements)
-
lastIndexOf
public int lastIndexOf(Object element)
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfaceList<E>
-
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)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
addAll
public boolean addAll(Collection<? extends E> collection)
-
retainAll
public boolean retainAll(Collection<?> collection)
-
-