Class WeightedSelectorMutable<T>
java.lang.Object
org.aksw.commons.collections.selector.WeightedSelectorMutableBase<T>
org.aksw.commons.collections.selector.WeightedSelectorMutable<T>
- All Implemented Interfaces:
Cloneable, WeightedSelector<T>
- Direct Known Subclasses:
WeigthedSelectorDrawWithReplacement
-
Field Summary
Fields inherited from class WeightedSelectorMutableBase
entries, nextOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Cloning mechanism to allow simple implementation of backtracking.static <X,T, S> S configure(Function<List<Map.Entry<T, ? extends Number>>, S> ctor, Iterable<X> items, Function<? super X, ? extends T> getEntity, Function<? super X, ? extends Number> getWeight) static <T> WeightedSelectorMutable<T> static <X,T> WeightedSelectorMutable <T> create(Iterable<X> items, Function<? super X, ? extends T> getEntity, Function<? super X, ? extends Number> getWeight) static <T> WeightedSelectorMutable<T> Methods inherited from class WeightedSelectorMutableBase
entries, eps, put, put, putAll, remove, sampleEntry, sampleEntryWithIndexMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WeightedSelector
entryMap, isEmpty, sample
-
Constructor Details
-
WeightedSelectorMutable
public WeightedSelectorMutable() -
WeightedSelectorMutable
-
-
Method Details
-
clone
Description copied from interface:WeightedSelectorCloning mechanism to allow simple implementation of backtracking.- Specified by:
clonein interfaceWeightedSelector<T>- Specified by:
clonein classWeightedSelectorMutableBase<T>- Returns:
-
create
-
create
public static <T> WeightedSelectorMutable<T> create(Iterable<T> items, Function<? super T, ? extends Number> getWeight) -
create
public static <X,T> WeightedSelectorMutable<T> create(Iterable<X> items, Function<? super X, ? extends T> getEntity, Function<? super X, ? extends Number> getWeight) -
configure
-