Package org.jgrapht.util
Class UnmodifiableUnionSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- org.jgrapht.util.UnmodifiableUnionSet<E>
-
- Type Parameters:
E
- the element type
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Set<E>
public class UnmodifiableUnionSet<E> extends AbstractSet<E> implements Serializable
An unmodifiable live view of the union of two sets.- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UnmodifiableUnionSet(Set<E> first, Set<E> second)
Constructs a new set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Object o)
Iterator<E>
iterator()
int
size()
Since the view is live, this operation is no longer a constant time operation.-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, 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, toArray
-
-
-
-
Method Detail
-
size
public int size()
Since the view is live, this operation is no longer a constant time operation.- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceSet<E>
- Specified by:
size
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>
-
-