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 TypeMethodDescriptionboolean
void
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
Add the given element if it is not contained in this instance, yet.int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T1> T1[]
toArray
(T1[] a) 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
Methods 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:
obj
if 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:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear() -
toString
-
equals
-
hashCode
public int hashCode()
-