Package org.objectweb.asm.tree.analysis
Class SmallSet<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractSet<T>
org.objectweb.asm.tree.analysis.SmallSet<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
An immutable set of at most two elements, optimized for speed compared to a generic set
implementation.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, 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
-
Field Details
-
element1
The first element of this set, maybe null. -
element2
-
-
Constructor Details
-
Method Details
-
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceSet<T>
- Specified by:
size
in classAbstractCollection<T>
-
union
Returns the union of this set and of the given set.- Parameters:
otherSet
- another small set.- Returns:
- the union of this set and of otherSet.
-