Package org.apache.wayang.core.util
Class Canonicalizer<T>
java.lang.Object
org.apache.wayang.core.util.Canonicalizer<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>
This utility maintains canonical sets of objects.
-
Constructor Summary
ConstructorsConstructorDescriptionCanonicalizer(int numExpectedEntries) Canonicalizer(Iterable<? extends T> objs) Canonicalizer(Collection<? extends T> objs) Canonicalizer(T... objs) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidbooleanaddAll(Collection<? extends T> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanAdd the given element if it is not contained in this instance, yet.inthashCode()booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T1> T1[]toArray(T1[] a) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
Canonicalizer
public Canonicalizer(int numExpectedEntries) -
Canonicalizer
public Canonicalizer() -
Canonicalizer
-
Canonicalizer
-
Canonicalizer
-
-
Method Details
-
getOrAdd
Add the given element if it is not contained in this instance, yet.- Parameters:
obj- the element to be added potentially- Returns:
objif it was added, otherwise the existing element
-
addAll
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T1> T1[] toArray(T1[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear() -
toString
-
equals
-
hashCode
public int hashCode()
-