Class WeigthedSelectorDrawWithReplacement<T>
java.lang.Object
org.aksw.commons.collections.selector.WeightedSelectorMutableBase<T>
org.aksw.commons.collections.selector.WeightedSelectorMutable<T>
org.aksw.commons.collections.selector.WeigthedSelectorDrawWithReplacement<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Cloneable,WeightedSelector<T>
Weighted selector with draw with replacement semantics.
This means, any entry returned by sampleEntry
is removed from the candidate pool
and thus will no longer be returned by future invocations of these methods.
Note, that the convenience method sample is based on sampleEntry.
- Author:
- raven
-
Field Summary
Fields inherited from class org.aksw.commons.collections.selector.WeightedSelectorMutableBase
entries, nextOffset -
Constructor Summary
ConstructorsConstructorDescriptionWeigthedSelectorDrawWithReplacement(List<Map.Entry<T, ? extends Number>> entries) -
Method Summary
Modifier and TypeMethodDescriptionclone()Cloning mechanism to allow simple implementation of backtracking.static <T> WeigthedSelectorDrawWithReplacement<T>create(Collection<? extends Map.Entry<T, ? extends Number>> entries) static <T> WeigthedSelectorDrawWithReplacement<T>Methods inherited from class org.aksw.commons.collections.selector.WeightedSelectorMutable
configure, create, createMethods inherited from class org.aksw.commons.collections.selector.WeightedSelectorMutableBase
entries, eps, put, put, putAll, remove, sampleEntryWithIndexMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.collections.selector.WeightedSelector
entryMap, isEmpty, sample
-
Constructor Details
-
WeigthedSelectorDrawWithReplacement
public WeigthedSelectorDrawWithReplacement() -
WeigthedSelectorDrawWithReplacement
-
-
Method Details
-
clone
Description copied from interface:WeightedSelectorCloning mechanism to allow simple implementation of backtracking.- Specified by:
clonein interfaceWeightedSelector<T>- Overrides:
clonein classWeightedSelectorMutable<T>- Returns:
-
sampleEntry
- Specified by:
sampleEntryin interfaceWeightedSelector<T>- Overrides:
sampleEntryin classWeightedSelectorMutableBase<T>
-
create
-
create
public static <T> WeigthedSelectorDrawWithReplacement<T> create(Collection<? extends Map.Entry<T, ? extends Number>> entries)
-