Package org.objectweb.asm.tree.analysis
Class SmallSet<T>
java.lang.Object
java.util.AbstractCollection<E>
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, removeAllMethods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein 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.
-