Package com.hypixel.hytale.common.map
Class WeightedMap<T>
java.lang.Object
com.hypixel.hytale.common.map.WeightedMap<T>
- All Implemented Interfaces:
IWeightedMap<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classNested classes/interfaces inherited from interface com.hypixel.hytale.common.map.IWeightedMap
IWeightedMap.SeedCoordinateFunction<T> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> WeightedMap.Builder<T> builder(T[] emptyKeys) booleanvoidvoidforEachEntry(ObjDoubleConsumer<T> consumer) get(double value) get(double x, double z, BiDoubleToDoubleFunction supplier) <K> Tget(int seed, int x, int z, IWeightedMap.SeedCoordinateFunction<K> supplier, K k) get(int x, int z, BiIntToDoubleFunction supplier) get(long x, long z, BiLongToDoubleFunction supplier) get(DoubleSupplier supplier) T[]<K> IWeightedMap<K> resolveKeys(Function<T, K> mapper, IntFunction<K[]> arraySupplier) intsize()T[]toArray()toString()
-
Field Details
-
EPSILON
public static final double EPSILON- See Also:
-
ONE_MINUS_EPSILON
public static final double ONE_MINUS_EPSILON- See Also:
-
keySet
-
keys
-
values
private final double[] values -
sum
private final double sum
-
-
Constructor Details
-
WeightedMap
-
-
Method Details
-
builder
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
- Specified by:
getin interfaceIWeightedMap<T>
-
get
@Nullable public <K> T get(int seed, int x, int z, @Nonnull IWeightedMap.SeedCoordinateFunction<K> supplier, K k) - Specified by:
getin interfaceIWeightedMap<T>
-
size
public int size()- Specified by:
sizein interfaceIWeightedMap<T>
-
contains
- Specified by:
containsin interfaceIWeightedMap<T>
-
forEach
- Specified by:
forEachin interfaceIWeightedMap<T>
-
forEachEntry
- Specified by:
forEachEntryin interfaceIWeightedMap<T>
-
internalKeys
- Specified by:
internalKeysin interfaceIWeightedMap<T>
-
toArray
- Specified by:
toArrayin interfaceIWeightedMap<T>
-
resolveKeys
@Nonnull public <K> IWeightedMap<K> resolveKeys(@Nonnull Function<T, K> mapper, @Nonnull IntFunction<K[]> arraySupplier) - Specified by:
resolveKeysin interfaceIWeightedMap<T>
-
toString
-