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>
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
-
Field Summary
-
Constructor Summary
ConstructorDescriptionChainedSet
(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
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(Collection<?> col) boolean
isEmpty()
iterator()
boolean
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.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
-
Field Details
-
f_aSets
An array of Sets to enumerate.
-
-
Constructor Details
-
ChainedSet
Construct a ChainedSet with the provided Collection of Set objects.- Parameters:
col
- a Collection of Set objects
-
ChainedSet
Construct a ChainedSet from the existing ChainedSet and an additional Set object.- Parameters:
original
- the original ChainedSetset
- a Set object to append
-
ChainedSet
Construct a ChainedSet from the existing ChainedSet and an array of Set objects.- Parameters:
original
- the original ChainedSetaSets
- an array of Set objects
-
ChainedSet
Construct a ChainedSet with the provided array of Set objects.- Parameters:
aSets
- an array of Set objects
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
in classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
- Specified by:
isEmpty
in interfaceSet<E>
- Overrides:
isEmpty
in classAbstractCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceSet<E>
- Overrides:
contains
in classAbstractCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceSet<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
toArray
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceSet<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceSet<E>
- Overrides:
add
in classAbstractCollection<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceSet<E>
- Overrides:
addAll
in classAbstractCollection<E>
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceSet<E>
- Overrides:
remove
in classAbstractCollection<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceSet<E>
- Overrides:
removeAll
in classAbstractSet<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceSet<E>
- Overrides:
retainAll
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceSet<E>
- Overrides:
clear
in classAbstractCollection<E>
-