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 withSetbecause of the lack of agetmethod.
-
-
Constructor Summary
Constructors Constructor Description CanonicalizingSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T t)booleanaddAll(java.util.Collection<? extends T> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)static <T> CanonicalizingSet<T>emptySet()Tget(T t)booleanisEmpty()java.util.Iterator<T>iterator()voidmerge(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.booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()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
tis not contained in the set; otherwise the object contained in the set for whicht.equals(theObjectis 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)
-
-