Package weka.classifiers.lazy.AM.lattice
Class CanonicalizingSet<T>
- java.lang.Object
-
- weka.classifiers.lazy.AM.lattice.CanonicalizingSet<T>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.Set<T>
public class CanonicalizingSet<T> extends java.lang.Object implements java.util.Set<T>
A set implementation that can be used to retrieve canonical versions of objects; this is not possible withSet
because of the lack of aget
method.
-
-
Constructor Summary
Constructors Constructor Description CanonicalizingSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T t)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
static <T> CanonicalizingSet<T>
emptySet()
T
get(T t)
boolean
isEmpty()
java.util.Iterator<T>
iterator()
void
merge(T t, java.util.function.BiFunction<? super T,? super T,? extends T> remappingFunction)
Similar toMap.merge(Object, Object, BiFunction)
, but with the key and value being the same.boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T1> T1[]
toArray(T1[] a)
java.util.Set<T>
unwrap()
-
-
-
Method Detail
-
emptySet
public static <T> CanonicalizingSet<T> emptySet()
-
get
public T get(T t)
- Returns:
- null if
t
is not contained in the set; otherwise the object contained in the set for whicht.equals(theObject
is true.
-
merge
public void merge(T t, java.util.function.BiFunction<? super T,? super T,? extends T> remappingFunction)
Similar toMap.merge(Object, Object, BiFunction)
, but with the key and value being the same.
-
unwrap
public java.util.Set<T> unwrap()
- Returns:
- the underlying set
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<T> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T1> T1[] toArray(T1[] a)
-
add
public boolean add(T t)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-