Class ObjectDoubleHashMap<K>
- java.lang.Object
-
- org.eclipse.collections.impl.map.mutable.primitive.ObjectDoubleHashMap<K>
-
- All Implemented Interfaces:
Externalizable
,Serializable
,DoubleIterable
,MutableObjectDoubleMap<K>
,ObjectDoubleMap<K>
,PrimitiveIterable
public class ObjectDoubleHashMap<K> extends Object implements MutableObjectDoubleMap<K>, Externalizable
This file was automatically generated from template file objectPrimitiveHashMap.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
EMPTY_VALUE
-
Constructor Summary
Constructors Constructor Description ObjectDoubleHashMap()
ObjectDoubleHashMap(int initialCapacity)
ObjectDoubleHashMap(ObjectDoubleMap<? extends K> map)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description double
addToValue(K key, double toBeAdded)
boolean
allSatisfy(DoublePredicate predicate)
boolean
anySatisfy(DoublePredicate predicate)
void
appendString(Appendable appendable)
void
appendString(Appendable appendable, String separator)
void
appendString(Appendable appendable, String start, String separator, String end)
LazyDoubleIterable
asLazy()
MutableObjectDoubleMap<K>
asSynchronized()
MutableObjectDoubleMap<K>
asUnmodifiable()
double
average()
RichIterable<DoubleIterable>
chunk(int size)
void
clear()
<V> MutableCollection<V>
collect(DoubleToObjectFunction<? extends V> function)
void
compact()
Deprecated.since 12.0 - UsetrimToSize()
insteadboolean
contains(double value)
boolean
containsAll(double... source)
boolean
containsAll(DoubleIterable source)
boolean
containsKey(Object key)
boolean
containsValue(double value)
int
count(DoublePredicate predicate)
double
detectIfNone(DoublePredicate predicate, double ifNone)
MutableDoubleIterator
doubleIterator()
void
each(DoubleProcedure procedure)
boolean
equals(Object obj)
MutableDoubleObjectMap<K>
flipUniqueValues()
void
forEachKey(Procedure<? super K> procedure)
void
forEachKeyValue(ObjectDoubleProcedure<? super K> procedure)
void
forEachValue(DoubleProcedure procedure)
double
get(Object key)
double
getAndPut(K key, double putValue, double defaultValue)
double
getIfAbsent(Object key, double ifAbsent)
double
getIfAbsentPut(K key, double value)
double
getIfAbsentPut(K key, DoubleFunction0 function)
<P> double
getIfAbsentPutWith(K key, DoubleFunction<? super P> function, P parameter)
double
getIfAbsentPutWithKey(K key, DoubleFunction<? super K> function)
double
getOrThrow(Object key)
int
hashCode()
<V> V
injectInto(V injectedValue, ObjectDoubleToObjectFunction<? super V,? extends V> function)
boolean
isEmpty()
Set<K>
keySet()
LazyIterable<K>
keysView()
RichIterable<ObjectDoublePair<K>>
keyValuesView()
String
makeString()
String
makeString(String separator)
String
makeString(String start, String separator, String end)
double
max()
double
maxIfEmpty(double defaultValue)
double
median()
double
min()
double
minIfEmpty(double defaultValue)
static <K> ObjectDoubleHashMap<K>
newMap()
static <K> ObjectDoubleHashMap<K>
newWithKeysValues(K key1, double value1)
static <K> ObjectDoubleHashMap<K>
newWithKeysValues(K key1, double value1, K key2, double value2)
static <K> ObjectDoubleHashMap<K>
newWithKeysValues(K key1, double value1, K key2, double value2, K key3, double value3)
static <K> ObjectDoubleHashMap<K>
newWithKeysValues(K key1, double value1, K key2, double value2, K key3, double value3, K key4, double value4)
boolean
noneSatisfy(DoublePredicate predicate)
boolean
notEmpty()
void
put(K key, double value)
void
putAll(ObjectDoubleMap<? extends K> map)
void
readExternal(ObjectInput in)
MutableDoubleCollection
reject(DoublePredicate predicate)
ObjectDoubleHashMap<K>
reject(ObjectDoublePredicate<? super K> predicate)
void
remove(Object key)
void
removeKey(K key)
double
removeKeyIfAbsent(K key, double value)
MutableDoubleCollection
select(DoublePredicate predicate)
ObjectDoubleHashMap<K>
select(ObjectDoublePredicate<? super K> predicate)
int
size()
double
sum()
double[]
toArray()
double[]
toArray(double[] target)
MutableDoubleBag
toBag()
ImmutableObjectDoubleMap<K>
toImmutable()
MutableDoubleList
toList()
MutableDoubleSet
toSet()
double[]
toSortedArray()
MutableDoubleList
toSortedList()
String
toString()
boolean
trimToSize()
double
updateValue(K key, double initialValueIfAbsent, DoubleToDoubleFunction function)
void
updateValues(ObjectDoubleToDoubleFunction<? super K> function)
MutableDoubleCollection
values()
ObjectDoubleHashMap<K>
withKeysValues(K key1, double value1, K key2, double value2)
ObjectDoubleHashMap<K>
withKeysValues(K key1, double value1, K key2, double value2, K key3, double value3)
ObjectDoubleHashMap<K>
withKeysValues(K key1, double value1, K key2, double value2, K key3, double value3, K key4, double value4)
ObjectDoubleHashMap<K>
withKeyValue(K key1, double value1)
ObjectDoubleHashMap<K>
withoutAllKeys(Iterable<? extends K> keys)
ObjectDoubleHashMap<K>
withoutKey(K key)
void
writeExternal(ObjectOutput out)
-
Methods inherited from interface org.eclipse.collections.api.DoubleIterable
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap
putPair, tap, withAllKeyValues
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.ObjectDoubleMap
injectIntoKeyValue
-
-
-
-
Field Detail
-
EMPTY_VALUE
public static final double EMPTY_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ObjectDoubleHashMap
public ObjectDoubleHashMap()
-
ObjectDoubleHashMap
public ObjectDoubleHashMap(int initialCapacity)
-
ObjectDoubleHashMap
public ObjectDoubleHashMap(ObjectDoubleMap<? extends K> map)
-
-
Method Detail
-
newMap
public static <K> ObjectDoubleHashMap<K> newMap()
-
newWithKeysValues
public static <K> ObjectDoubleHashMap<K> newWithKeysValues(K key1, double value1)
-
newWithKeysValues
public static <K> ObjectDoubleHashMap<K> newWithKeysValues(K key1, double value1, K key2, double value2)
-
newWithKeysValues
public static <K> ObjectDoubleHashMap<K> newWithKeysValues(K key1, double value1, K key2, double value2, K key3, double value3)
-
newWithKeysValues
public static <K> ObjectDoubleHashMap<K> newWithKeysValues(K key1, double value1, K key2, double value2, K key3, double value3, K key4, double value4)
-
toString
public String toString()
- Specified by:
toString
in interfaceObjectDoubleMap<K>
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfacePrimitiveIterable
-
makeString
public String makeString()
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String separator)
- Specified by:
makeString
in interfacePrimitiveIterable
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfacePrimitiveIterable
-
doubleIterator
public MutableDoubleIterator doubleIterator()
- Specified by:
doubleIterator
in interfaceDoubleIterable
- Specified by:
doubleIterator
in interfaceMutableObjectDoubleMap<K>
-
toArray
public double[] toArray()
- Specified by:
toArray
in interfaceDoubleIterable
-
toArray
public double[] toArray(double[] target)
- Specified by:
toArray
in interfaceDoubleIterable
-
contains
public boolean contains(double value)
- Specified by:
contains
in interfaceDoubleIterable
-
containsAll
public boolean containsAll(double... source)
- Specified by:
containsAll
in interfaceDoubleIterable
-
containsAll
public boolean containsAll(DoubleIterable source)
- Specified by:
containsAll
in interfaceDoubleIterable
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableObjectDoubleMap<K>
-
put
public void put(K key, double value)
- Specified by:
put
in interfaceMutableObjectDoubleMap<K>
-
putAll
public void putAll(ObjectDoubleMap<? extends K> map)
- Specified by:
putAll
in interfaceMutableObjectDoubleMap<K>
-
updateValues
public void updateValues(ObjectDoubleToDoubleFunction<? super K> function)
- Specified by:
updateValues
in interfaceMutableObjectDoubleMap<K>
-
removeKey
public void removeKey(K key)
- Specified by:
removeKey
in interfaceMutableObjectDoubleMap<K>
-
remove
public void remove(Object key)
- Specified by:
remove
in interfaceMutableObjectDoubleMap<K>
-
removeKeyIfAbsent
public double removeKeyIfAbsent(K key, double value)
- Specified by:
removeKeyIfAbsent
in interfaceMutableObjectDoubleMap<K>
-
getIfAbsentPut
public double getIfAbsentPut(K key, double value)
- Specified by:
getIfAbsentPut
in interfaceMutableObjectDoubleMap<K>
-
getAndPut
public double getAndPut(K key, double putValue, double defaultValue)
- Specified by:
getAndPut
in interfaceMutableObjectDoubleMap<K>
-
getIfAbsentPut
public double getIfAbsentPut(K key, DoubleFunction0 function)
- Specified by:
getIfAbsentPut
in interfaceMutableObjectDoubleMap<K>
-
getIfAbsentPutWith
public <P> double getIfAbsentPutWith(K key, DoubleFunction<? super P> function, P parameter)
- Specified by:
getIfAbsentPutWith
in interfaceMutableObjectDoubleMap<K>
-
getIfAbsentPutWithKey
public double getIfAbsentPutWithKey(K key, DoubleFunction<? super K> function)
- Specified by:
getIfAbsentPutWithKey
in interfaceMutableObjectDoubleMap<K>
-
updateValue
public double updateValue(K key, double initialValueIfAbsent, DoubleToDoubleFunction function)
- Specified by:
updateValue
in interfaceMutableObjectDoubleMap<K>
-
addToValue
public double addToValue(K key, double toBeAdded)
- Specified by:
addToValue
in interfaceMutableObjectDoubleMap<K>
-
withKeyValue
public ObjectDoubleHashMap<K> withKeyValue(K key1, double value1)
- Specified by:
withKeyValue
in interfaceMutableObjectDoubleMap<K>
-
withKeysValues
public ObjectDoubleHashMap<K> withKeysValues(K key1, double value1, K key2, double value2)
-
withKeysValues
public ObjectDoubleHashMap<K> withKeysValues(K key1, double value1, K key2, double value2, K key3, double value3)
-
withKeysValues
public ObjectDoubleHashMap<K> withKeysValues(K key1, double value1, K key2, double value2, K key3, double value3, K key4, double value4)
-
withoutKey
public ObjectDoubleHashMap<K> withoutKey(K key)
- Specified by:
withoutKey
in interfaceMutableObjectDoubleMap<K>
-
withoutAllKeys
public ObjectDoubleHashMap<K> withoutAllKeys(Iterable<? extends K> keys)
- Specified by:
withoutAllKeys
in interfaceMutableObjectDoubleMap<K>
-
asUnmodifiable
public MutableObjectDoubleMap<K> asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableObjectDoubleMap<K>
-
asSynchronized
public MutableObjectDoubleMap<K> asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableObjectDoubleMap<K>
-
toImmutable
public ImmutableObjectDoubleMap<K> toImmutable()
- Specified by:
toImmutable
in interfaceObjectDoubleMap<K>
-
get
public double get(Object key)
- Specified by:
get
in interfaceObjectDoubleMap<K>
-
getOrThrow
public double getOrThrow(Object key)
- Specified by:
getOrThrow
in interfaceObjectDoubleMap<K>
-
getIfAbsent
public double getIfAbsent(Object key, double ifAbsent)
- Specified by:
getIfAbsent
in interfaceObjectDoubleMap<K>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceObjectDoubleMap<K>
-
containsValue
public boolean containsValue(double value)
- Specified by:
containsValue
in interfaceObjectDoubleMap<K>
-
each
public void each(DoubleProcedure procedure)
- Specified by:
each
in interfaceDoubleIterable
- Since:
- 7.0.
-
forEachValue
public void forEachValue(DoubleProcedure procedure)
- Specified by:
forEachValue
in interfaceObjectDoubleMap<K>
-
forEachKey
public void forEachKey(Procedure<? super K> procedure)
- Specified by:
forEachKey
in interfaceObjectDoubleMap<K>
-
forEachKeyValue
public void forEachKeyValue(ObjectDoubleProcedure<? super K> procedure)
- Specified by:
forEachKeyValue
in interfaceObjectDoubleMap<K>
-
select
public ObjectDoubleHashMap<K> select(ObjectDoublePredicate<? super K> predicate)
- Specified by:
select
in interfaceMutableObjectDoubleMap<K>
- Specified by:
select
in interfaceObjectDoubleMap<K>
-
reject
public ObjectDoubleHashMap<K> reject(ObjectDoublePredicate<? super K> predicate)
- Specified by:
reject
in interfaceMutableObjectDoubleMap<K>
- Specified by:
reject
in interfaceObjectDoubleMap<K>
-
select
public MutableDoubleCollection select(DoublePredicate predicate)
- Specified by:
select
in interfaceDoubleIterable
- Specified by:
select
in interfaceMutableObjectDoubleMap<K>
-
reject
public MutableDoubleCollection reject(DoublePredicate predicate)
- Specified by:
reject
in interfaceDoubleIterable
- Specified by:
reject
in interfaceMutableObjectDoubleMap<K>
-
detectIfNone
public double detectIfNone(DoublePredicate predicate, double ifNone)
- Specified by:
detectIfNone
in interfaceDoubleIterable
-
collect
public <V> MutableCollection<V> collect(DoubleToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceDoubleIterable
- Specified by:
collect
in interfaceMutableObjectDoubleMap<K>
-
count
public int count(DoublePredicate predicate)
- Specified by:
count
in interfaceDoubleIterable
-
anySatisfy
public boolean anySatisfy(DoublePredicate predicate)
- Specified by:
anySatisfy
in interfaceDoubleIterable
-
allSatisfy
public boolean allSatisfy(DoublePredicate predicate)
- Specified by:
allSatisfy
in interfaceDoubleIterable
-
noneSatisfy
public boolean noneSatisfy(DoublePredicate predicate)
- Specified by:
noneSatisfy
in interfaceDoubleIterable
-
injectInto
public <V> V injectInto(V injectedValue, ObjectDoubleToObjectFunction<? super V,? extends V> function)
- Specified by:
injectInto
in interfaceDoubleIterable
-
chunk
public RichIterable<DoubleIterable> chunk(int size)
- Specified by:
chunk
in interfaceDoubleIterable
-
sum
public double sum()
- Specified by:
sum
in interfaceDoubleIterable
-
max
public double max()
- Specified by:
max
in interfaceDoubleIterable
-
min
public double min()
- Specified by:
min
in interfaceDoubleIterable
-
maxIfEmpty
public double maxIfEmpty(double defaultValue)
- Specified by:
maxIfEmpty
in interfaceDoubleIterable
-
minIfEmpty
public double minIfEmpty(double defaultValue)
- Specified by:
minIfEmpty
in interfaceDoubleIterable
-
average
public double average()
- Specified by:
average
in interfaceDoubleIterable
-
median
public double median()
- Specified by:
median
in interfaceDoubleIterable
-
toList
public MutableDoubleList toList()
- Specified by:
toList
in interfaceDoubleIterable
-
toSet
public MutableDoubleSet toSet()
- Specified by:
toSet
in interfaceDoubleIterable
-
toBag
public MutableDoubleBag toBag()
- Specified by:
toBag
in interfaceDoubleIterable
-
asLazy
public LazyDoubleIterable asLazy()
- Specified by:
asLazy
in interfaceDoubleIterable
-
toSortedArray
public double[] toSortedArray()
- Specified by:
toSortedArray
in interfaceDoubleIterable
-
toSortedList
public MutableDoubleList toSortedList()
- Specified by:
toSortedList
in interfaceDoubleIterable
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
keysView
public LazyIterable<K> keysView()
- Specified by:
keysView
in interfaceObjectDoubleMap<K>
-
keyValuesView
public RichIterable<ObjectDoublePair<K>> keyValuesView()
- Specified by:
keyValuesView
in interfaceObjectDoubleMap<K>
-
flipUniqueValues
public MutableDoubleObjectMap<K> flipUniqueValues()
- Specified by:
flipUniqueValues
in interfaceMutableObjectDoubleMap<K>
- Specified by:
flipUniqueValues
in interfaceObjectDoubleMap<K>
-
trimToSize
public boolean trimToSize()
- Since:
- 12.0
-
compact
@Deprecated public void compact()
Deprecated.since 12.0 - UsetrimToSize()
insteadRehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
-
keySet
public Set<K> keySet()
- Specified by:
keySet
in interfaceObjectDoubleMap<K>
-
values
public MutableDoubleCollection values()
- Specified by:
values
in interfaceObjectDoubleMap<K>
-
-