Package com.tangosol.util
Class WrapperCollections.AbstractWrapperCollection<E>
- java.lang.Object
-
- com.tangosol.util.WrapperCollections.AbstractWrapperCollection<E>
-
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>
- Direct Known Subclasses:
WrapperCollections.AbstractWrapperList,WrapperCollections.AbstractWrapperSet
- Enclosing class:
- WrapperCollections
public abstract static class WrapperCollections.AbstractWrapperCollection<E> extends Object implements Collection<E>, Serializable
Collection implementation which delegates all calls to another Collection.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<E>m_colDelegateThe Collection to which this wrapper delegates.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWrapperCollection()Default constructorprotectedAbstractWrapperCollection(Collection<E> col)Create an AbstractWrapperCollection which delegates to the specified Collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E o)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object o)voidforEach(Consumer<? super E> action)protected Collection<E>getDelegate()Return the Collection to which all operations should be delegated to.inthashCode()booleanisEmpty()Iterator<E>iterator()Stream<E>parallelStream()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveIf(Predicate<? super E> filter)booleanretainAll(Collection<?> c)intsize()Spliterator<E>spliterator()Stream<E>stream()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
toArray
-
-
-
-
Field Detail
-
m_colDelegate
protected Collection<E> m_colDelegate
The Collection to which this wrapper delegates.
-
-
Constructor Detail
-
AbstractWrapperCollection
protected AbstractWrapperCollection()
Default constructor
-
AbstractWrapperCollection
protected AbstractWrapperCollection(Collection<E> col)
Create an AbstractWrapperCollection which delegates to the specified Collection.- Parameters:
col- the Collection to delegate all calls to
-
-
Method Detail
-
getDelegate
protected Collection<E> getDelegate()
Return the Collection to which all operations should be delegated to.- Returns:
- the wrapped Collection
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<E>
-
add
public boolean add(E o)
- Specified by:
addin interfaceCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAllin interfaceCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>
-
spliterator
public Spliterator<E> spliterator()
- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>
-
removeIf
public boolean removeIf(Predicate<? super E> filter)
- Specified by:
removeIfin interfaceCollection<E>
-
stream
public Stream<E> stream()
- Specified by:
streamin interfaceCollection<E>
-
parallelStream
public Stream<E> parallelStream()
- Specified by:
parallelStreamin interfaceCollection<E>
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<E>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<E>- Overrides:
hashCodein classObject
-
-