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 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.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:
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
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<E>
- Specified by:
contains
in interfaceSet<E>
- Overrides:
contains
in classAbstractCollection<E>
-
containsAll
public boolean containsAll(Collection<?> col)
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<E>
- Specified by:
toArray
in interfaceSet<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>
- Specified by:
toArray
in interfaceSet<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
add
public boolean add(E e)
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceSet<E>
- Overrides:
add
in classAbstractCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceSet<E>
- Overrides:
addAll
in classAbstractCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<E>
- Specified by:
remove
in interfaceSet<E>
- Overrides:
remove
in classAbstractCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceSet<E>
- Overrides:
removeAll
in classAbstractSet<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- 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>
-
-