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_colDelegate
The Collection to which this wrapper delegates.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWrapperCollection()
Default constructorprotected
AbstractWrapperCollection(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 boolean
add(E o)
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)
protected Collection<E>
getDelegate()
Return the Collection to which all operations should be delegated to.int
hashCode()
boolean
isEmpty()
Iterator<E>
iterator()
Stream<E>
parallelStream()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
removeIf(Predicate<? super E> filter)
boolean
retainAll(Collection<?> c)
int
size()
Spliterator<E>
spliterator()
Stream<E>
stream()
Object[]
toArray()
<T> T[]
toArray(T[] a)
String
toString()
-
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:
size
in interfaceCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<E>
-
add
public boolean add(E o)
- Specified by:
add
in interfaceCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll
in interfaceCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<E>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<E>
-
spliterator
public Spliterator<E> spliterator()
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
-
removeIf
public boolean removeIf(Predicate<? super E> filter)
- Specified by:
removeIf
in interfaceCollection<E>
-
stream
public Stream<E> stream()
- Specified by:
stream
in interfaceCollection<E>
-
parallelStream
public Stream<E> parallelStream()
- Specified by:
parallelStream
in interfaceCollection<E>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<E>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<E>
- Overrides:
hashCode
in classObject
-
-