Package com.tangosol.util
Class ChainedSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- com.tangosol.util.ChainedSet<E>
-
- Type Parameters:
E- the type of Set elements
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>
public class ChainedSet<E> extends AbstractSet<E>
An unmodifiable Set that provides access to many sets in the given order.Note that this implementation does not ensure that the elements are unique across all chained sets. It is up to the user to provide that guarantee.
- Since:
- Coherence 23.03
- Author:
- as 2023.03.03
-
-
Constructor Summary
Constructors Constructor Description ChainedSet(ChainedSet<E> original, Set<E> set)Construct a ChainedSet from the existing ChainedSet and an additional Set object.ChainedSet(ChainedSet<E> original, Set<E>... aSets)Construct a ChainedSet from the existing ChainedSet and an array of Set objects.ChainedSet(Collection<Set<E>> col)Construct a ChainedSet with the provided Collection of Set objects.ChainedSet(Set<E>... aSets)Construct a ChainedSet with the provided array of Set objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> col)booleanisEmpty()Iterator<E>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(IntFunction<T[]> generator)<T> T[]toArray(T[] a)-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Constructor Detail
-
ChainedSet
public ChainedSet(Collection<Set<E>> col)
Construct a ChainedSet with the provided Collection of Set objects.- Parameters:
col- a Collection of Set objects
-
ChainedSet
public ChainedSet(ChainedSet<E> original, Set<E> set)
Construct a ChainedSet from the existing ChainedSet and an additional Set object.- Parameters:
original- the original ChainedSetset- a Set object to append
-
ChainedSet
public ChainedSet(ChainedSet<E> original, Set<E>... aSets)
Construct a ChainedSet from the existing ChainedSet and an array of Set objects.- Parameters:
original- the original ChainedSetaSets- an array of Set objects
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceSet<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<E>
-
containsAll
public boolean containsAll(Collection<?> col)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>- Overrides:
containsAllin classAbstractCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceSet<E>- Overrides:
toArrayin classAbstractCollection<E>
-
toArray
public <T> T[] toArray(IntFunction<T[]> generator)
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceSet<E>- Overrides:
toArrayin classAbstractCollection<E>
-
add
public boolean add(E e)
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceSet<E>- Overrides:
addAllin classAbstractCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceSet<E>- Overrides:
removeAllin classAbstractSet<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceSet<E>- Overrides:
retainAllin classAbstractCollection<E>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classAbstractCollection<E>
-
-