public class FloatMap<V> extends Object implements ISortedMap<Double,V>, Cloneable
IntMap, with which it shares performance characteristics.
Since this is intended foremost as a sorted data structure, it does not allow NaN and treats -0.0 as
equivalent to 0.0. Anyone looking for identity-based semantics should use a normal Map instead.| Constructor and Description |
|---|
FloatMap() |
| Modifier and Type | Method and Description |
|---|---|
IEntry<Double,V> |
ceil(double key) |
IEntry<Double,V> |
ceil(Double key) |
FloatMap<V> |
clone() |
Comparator<Double> |
comparator() |
boolean |
contains(double key) |
FloatMap<V> |
difference(IMap<Double,?> b) |
FloatMap<V> |
difference(ISet<Double> keys) |
IList<IEntry<Double,V>> |
entries() |
boolean |
equals(IMap<Double,V> o,
BiPredicate<V,V> valEquals) |
boolean |
equals(Object obj) |
IEntry<Double,V> |
floor(double key) |
IEntry<Double,V> |
floor(Double key) |
FloatMap<V> |
forked()
This returns a data structure which is forked, which is equivalent to Clojure's persistent
data structures, also sometimes called functional or immutable.
|
static <V> FloatMap<V> |
from(Collection<Map.Entry<Number,V>> collection) |
static <V> FloatMap<V> |
from(IList<IEntry<Number,V>> list) |
static <V> FloatMap<V> |
from(IMap<Number,V> m) |
static <V> FloatMap<V> |
from(Map<Number,V> m) |
Optional<V> |
get(double key) |
V |
get(double key,
V defaultValue) |
V |
get(Double key,
V defaultValue) |
int |
hashCode() |
OptionalLong |
indexOf(double key) |
OptionalLong |
indexOf(Double key) |
FloatMap<V> |
intersection(IMap<Double,?> b) |
FloatMap<V> |
intersection(ISet<Double> keys) |
boolean |
isLinear() |
BiPredicate<Double,Double> |
keyEquality() |
ToLongFunction<Double> |
keyHash() |
FloatMap<V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
<U> FloatMap<U> |
mapValues(BiFunction<Double,V,U> f) |
FloatMap<V> |
merge(IMap<Double,V> b,
BinaryOperator<V> mergeFn) |
IEntry<Double,V> |
nth(long idx) |
FloatMap<V> |
put(double key,
V value) |
FloatMap<V> |
put(Double key,
V value) |
FloatMap<V> |
put(double key,
V value,
BinaryOperator<V> merge) |
FloatMap<V> |
put(Double key,
V value,
BinaryOperator<V> merge) |
FloatMap<V> |
put(double key,
V value,
BinaryOperator<V> merge,
Object editor) |
FloatMap<V> |
put(double key,
V value,
Object editor) |
FloatMap<V> |
remove(double key) |
FloatMap<V> |
remove(Double key) |
FloatMap<V> |
remove(double key,
Object editor) |
long |
size() |
FloatMap<V> |
slice(double min,
double max) |
FloatMap<V> |
slice(Double min,
Double max) |
List<FloatMap<V>> |
split(int parts)
Splits the collection into roughly even pieces, for parallel processing.
|
String |
toString() |
FloatMap<V> |
union(IMap<Double,V> m) |
FloatMap<V> |
update(double key,
UnaryOperator<V> update) |
FloatMap<V> |
update(Double key,
UnaryOperator<V> update) |
FloatMap<V> |
update(double key,
UnaryOperator<V> update,
Object editor) |
finalize, getClass, notify, notifyAll, wait, wait, waitfirst, lastapply, contains, containsAll, containsAll, containsAny, containsAny, get, getOrCreate, hashSortedEntries, iterator, keys, save, spliterator, stream, toMap, valuesnth, savepublic static <V> FloatMap<V> from(Map<Number,V> m)
m - a Java mappublic static <V> FloatMap<V> from(Collection<Map.Entry<Number,V>> collection)
public Comparator<Double> comparator()
comparator in interface ISortedMap<Double,V>public ToLongFunction<Double> keyHash()
public BiPredicate<Double,Double> keyEquality()
keyEquality in interface IMap<Double,V>public boolean contains(double key)
public OptionalLong indexOf(double key)
public OptionalLong indexOf(Double key)
public long size()
public IEntry<Double,V> floor(Double key)
floor in interface ISortedMap<Double,V>key, or just below it. If key is less than the
minimum value in the map, returns null.public IEntry<Double,V> ceil(Double key)
ceil in interface ISortedMap<Double,V>key, or just above it. If key is greater than the
maximum value in the map, returns null.public FloatMap<V> slice(Double min, Double max)
slice in interface ISortedMap<Double,V>min - the inclusive minimum key valuemax - the inclusive maximum key valuepublic FloatMap<V> difference(ISet<Double> keys)
difference in interface IMap<Double,V>difference in interface ISortedMap<Double,V>keyspublic FloatMap<V> intersection(ISet<Double> keys)
intersection in interface IMap<Double,V>intersection in interface ISortedMap<Double,V>keyspublic FloatMap<V> difference(IMap<Double,?> b)
difference in interface IMap<Double,V>difference in interface ISortedMap<Double,V>mpublic FloatMap<V> intersection(IMap<Double,?> b)
intersection in interface IMap<Double,V>mpublic FloatMap<V> put(double key, V value)
key - a primitive long keyvalue - a valueFloatMap with value under keypublic FloatMap<V> put(double key, V value, BinaryOperator<V> merge)
key - a primitive long keyvalue - a valuemerge - a function which will be invoked if there is a pre-existing value under key, with the current
value as the first argument and new value as the second, to determine the combined resultpublic FloatMap<V> put(Double key, V value, BinaryOperator<V> merge)
put in interface IMap<Double,V>put in interface ISortedMap<Double,V>merge - a function which will be invoked if there is a pre-existing value under key, with the current
value as the first argument and new value as the second, to determine the combined resultvalue under keypublic <U> FloatMap<U> mapValues(BiFunction<Double,V,U> f)
public FloatMap<V> update(Double key, UnaryOperator<V> update)
public FloatMap<V> update(double key, UnaryOperator<V> update)
public FloatMap<V> update(double key, UnaryOperator<V> update, Object editor)
public List<FloatMap<V>> split(int parts)
ICollectionparts subsets.public boolean isLinear()
public FloatMap<V> forked()
ICollectionIf only a single function or scope uses the data structure, it can be left as a linear data structure, which can have significant performance benefits.
If the data structure is already forked, it will simply return itself.
public FloatMap<V> linear()
ICollection
If ICollection.forked() is called on a linear collection, all references to that linear collection should be discarded.
If the data structure is already linear, it will simply return itself.