Package org.silverpeas.core.util
Class SilverpeasListWrapper<E>
- java.lang.Object
-
- org.silverpeas.core.util.SilverpeasListWrapper<E>
-
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,List<E>
,SilverpeasList<E>
- Direct Known Subclasses:
PaginationList
public class SilverpeasListWrapper<E> extends Object implements SilverpeasList<E>
A wrapper ofList
instances.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, E element)
boolean
add(E e)
boolean
addAll(int index, Collection<? extends E> c)
boolean
addAll(Collection<? extends E> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object o)
void
forEach(Consumer<? super E> action)
E
get(int index)
int
hashCode()
int
indexOf(Object o)
boolean
isEmpty()
Iterator<E>
iterator()
int
lastIndexOf(Object o)
ListIterator<E>
listIterator()
ListIterator<E>
listIterator(int index)
<U> SilverpeasList<U>
newEmptyListWithSameProperties()
Builds a new emptySilverpeasList
with the same properties than this list.long
originalListSize()
Gets the number of items the original list contains.E
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
removeIf(Predicate<? super E> filter)
void
replaceAll(UnaryOperator<E> operator)
boolean
retainAll(Collection<?> c)
E
set(int index, E element)
int
size()
void
sort(Comparator<? super E> c)
Spliterator<E>
spliterator()
List<E>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface org.silverpeas.core.util.SilverpeasList
isSlice
-
-
-
-
Method Detail
-
newEmptyListWithSameProperties
public <U> SilverpeasList<U> newEmptyListWithSameProperties()
Description copied from interface:SilverpeasList
Builds a new emptySilverpeasList
with the same properties than this list.This method is mainly dedicated to be used for making a collector for the Java Stream API.
- Specified by:
newEmptyListWithSameProperties
in interfaceSilverpeasList<E>
- Type Parameters:
U
- the concrete type of the items of the returned list.- Returns:
- an empty
SilverpeasList
with the same properties than this list.
-
originalListSize
public long originalListSize()
Description copied from interface:SilverpeasList
Gets the number of items the original list contains.If the list is a slice of a larger one, the
SilverpeasList.originalListSize()
returns a higher result than the one ofList.size()
, otherwiseSilverpeasList.originalListSize()
andList.size()
returns the same result.- Specified by:
originalListSize
in interfaceSilverpeasList<E>
- Returns:
- the original size of the list as long.
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<E>
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(Object o)
-
clear
public void clear()
-
addAll
public boolean addAll(Collection<? extends E> c)
-
addAll
public boolean addAll(int index, Collection<? extends E> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIterator
in interfaceList<E>
-
spliterator
public Spliterator<E> spliterator()
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
- Specified by:
spliterator
in interfaceList<E>
-
removeIf
public boolean removeIf(Predicate<? super E> filter)
- Specified by:
removeIf
in interfaceCollection<E>
-
replaceAll
public void replaceAll(UnaryOperator<E> operator)
- Specified by:
replaceAll
in interfaceList<E>
-
sort
public void sort(Comparator<? super E> c)
-
-