Class FuzzySet<T>
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.util.FuzzySet<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>
A set that allows for fuzzy matching of elements.
-
Constructor Summary
ConstructorsConstructorDescriptionFuzzySet(BiPredicate<T, T> cutoff, Function<Collection<T>, T> averager) Creates a new fuzzy set with the given cutoff and averager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(@NonNull Collection<? extends T> collection) voidclear()booleanbooleancontainsAll(@NonNull Collection<?> collection) booleanisEmpty()iterator()booleanbooleanremoveAll(@NonNull Collection<?> collection) booleanretainAll(@NonNull Collection<?> collection) intsize()Object @NonNull []toArray()<T1> T1 @NonNull []toArray(T1 @NonNull [] t1s) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
FuzzySet
Creates a new fuzzy set with the given cutoff and averager.- Parameters:
cutoff- determines whether two elements are close enough to consider them equivalentaverager- determines the "average" of a set of elements
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T1> T1 @NonNull [] toArray(T1 @NonNull [] t1s) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear()
-