Package com.tangosol.util
Class ChainedCollection<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.tangosol.util.ChainedCollection<E>
-
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
public class ChainedCollection<E> extends AbstractCollection<E>
An unmodifiable Collection that provides access to many collections in the given order.- Since:
- Coherence 12.1.2
- Author:
- hr 2014.02.19
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<E>[]
f_aCol
An array of Collections to enumerate.
-
Constructor Summary
Constructors Constructor Description ChainedCollection(ChainedCollection<E> original, Collection<E> col)
Construct a ChainedCollection from the existing ChainedCollection and an additional Collection object.ChainedCollection(ChainedCollection<E> original, Collection<E>... aCol)
Construct a ChainedCollection from the existing ChainedCollection and an array of Collection objects.ChainedCollection(Collection<E>... aCol)
Construct a ChainedCollection with the provided array of Collection objects.ChainedCollection(Collection<Collection<E>> col)
Construct a ChainedCollection with the provided Collection of Collection objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(Collection<? extends E> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> col)
boolean
isEmpty()
Iterator<E>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<T> T[]
toArray(IntFunction<T[]> generator)
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.util.AbstractCollection
toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream
-
-
-
-
Field Detail
-
f_aCol
protected final Collection<E>[] f_aCol
An array of Collections to enumerate.
-
-
Constructor Detail
-
ChainedCollection
public ChainedCollection(Collection<Collection<E>> col)
Construct a ChainedCollection with the provided Collection of Collection objects.- Parameters:
col
- a Collection of Collection objects
-
ChainedCollection
public ChainedCollection(ChainedCollection<E> original, Collection<E> col)
Construct a ChainedCollection from the existing ChainedCollection and an additional Collection object.- Parameters:
original
- the original ChainedCollectioncol
- a Collection object to append
-
ChainedCollection
@SafeVarargs public ChainedCollection(ChainedCollection<E> original, Collection<E>... aCol)
Construct a ChainedCollection from the existing ChainedCollection and an array of Collection objects.- Parameters:
original
- the original ChainedSetaCol
- an array of Collection objects
-
ChainedCollection
@SafeVarargs public ChainedCollection(Collection<E>... aCol)
Construct a ChainedCollection with the provided array of Collection objects.- Parameters:
aCol
- an array of Collection objects
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<E>
- Overrides:
isEmpty
in classAbstractCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<E>
- Overrides:
contains
in classAbstractCollection<E>
-
containsAll
public boolean containsAll(Collection<?> col)
- Specified by:
containsAll
in interfaceCollection<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
iterator
public Iterator<E> iterator()
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
toArray
public <T> T[] toArray(IntFunction<T[]> generator)
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
add
public boolean add(E e)
- Specified by:
add
in interfaceCollection<E>
- Overrides:
add
in classAbstractCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll
in interfaceCollection<E>
- Overrides:
addAll
in classAbstractCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
- Overrides:
remove
in classAbstractCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<E>
- Overrides:
removeAll
in classAbstractCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<E>
- Overrides:
retainAll
in classAbstractCollection<E>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractCollection<E>
-
-