Top Description Methods
org.eclipse.collections.api.map.primitive

public Interface ShortDoubleMap

extends DoubleValuesMap
Known Direct Subinterfaces
org.eclipse.collections.api.map.primitive.ImmutableShortDoubleMap, org.eclipse.collections.api.map.primitive.MutableShortDoubleMap
Imports
java.util.Map, org.eclipse.collections.api.LazyShortIterable, .RichIterable, org.eclipse.collections.api.block.predicate.primitive.ShortDoublePredicate, org.eclipse.collections.api.block.procedure.primitive.ShortDoubleProcedure, .ShortProcedure, org.eclipse.collections.api.block.function.primitive.ObjectShortDoubleToObjectFunction, org.eclipse.collections.api.set.primitive.MutableShortSet, org.eclipse.collections.api.tuple.primitive.ShortDoublePair

This file was automatically generated from template file primitivePrimitiveMap.stg.
Since
3.0.

Method Summary

Modifier and TypeMethod and Description
public default boolean
public boolean

Returns:

if a mapping exists in this map for the key
containsKey
(short
the key
key
)

Returns whether or not the key is present in the map.

public boolean
equals(Object o)

Follows the same general contract as Map#equals(Object).

public DoubleShortMap
flipUniqueValues()

Return the DoubleShortMap that is obtained by flipping the direction of this map and making the associations from value to key.

public void
forEachKey(ShortProcedure
the procedure to invoke for each key
procedure
)

Iterates through each key in the map, invoking the procedure for each.

public void
forEachKeyValue(ShortDoubleProcedure
the procedure to invoke for each key/value pair
procedure
)

Iterates through each key/value pair in the map, invoking the procedure for each.

public double

Returns:

the value associated with the key, or the default value if no such mapping exists
get
(short
the key
key
)

Retrieves the value associated with the key.

public double

Returns:

the value associated with the key, or ifAbsent if no such mapping exists.
getIfAbsent
(short
the key
key
,
double
the default value to return if no mapping exists for key
ifAbsent
)

Retrieves the value associated with the key, returning the specified default value if no such mapping exists.

public double

Returns:

the value associated with the key
getOrThrow
(short
the key
key
)

Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.

public int
hashCode()

Follows the same general contract as Map#hashCode().

public default <IV> IV

Returns:

result of injecting the injectedValue into the map
injectIntoKeyValue
(IV
value to be injected into the map
injectedValue
,
ObjectShortDoubleToObjectFunction<? super IV, ? extends IV>
to apply to the injected value and key/value pairs
function
)

Implements the injectInto pattern with each key/value pair of the map.

public MutableShortSet

Returns:

a mutable set containing the keys in this map
keySet
()

Returns a set containing all the keys in this map.

public LazyShortIterable

Returns:

a view of the keys in this map
keysView
()

Returns a view of the keys in this map.

public RichIterable<ShortDoublePair>

Returns:

a view of the keys in this map
keyValuesView
()

Returns a view of the key/value pairs in this map.

public ShortDoubleMap

Returns:

a copy of this map without the matching key/value pairs
reject
(ShortDoublePredicate
the predicate to determine which key/value pairs in this map should be excluded from the returned map
predicate
)

Return a copy of this map containing only the key/value pairs that do not match the predicate.

public ShortDoubleMap

Returns:

a copy of this map with the matching key/value pairs
select
(ShortDoublePredicate
the predicate to determine which key/value pairs in this map should be included in the returned map
predicate
)

Return a copy of this map containing only the key/value pairs that match the predicate.

public ImmutableShortDoubleMap

Returns:

an immutable map that is equivalent to this one
toImmutable
()

Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.

public String

Returns:

a string representation of this ShortDoubleMap
toString
()

Redeclares org.eclipse.collections.api.PrimitiveIterable.toString.

Follows the same general contract as java.util.AbstractMap#toString()

Inherited from org.eclipse.collections.api.map.primitive.DoubleValuesMap:
collectcontainsValueforEachValuerejectselecttapvalues

Method Detail

allSatisfyKeyValueback to summary
public default boolean allSatisfyKeyValue(ShortDoublePredicate predicate)
Since
12.0
containsKeyback to summary
public boolean containsKey(short key)

Returns whether or not the key is present in the map.

Parameters
key:short

the key

Returns:boolean

if a mapping exists in this map for the key

equalsback to summary
public boolean equals(Object o)

Follows the same general contract as Map#equals(Object).

Annotations
@Override
flipUniqueValuesback to summary
public DoubleShortMap flipUniqueValues()

Return the DoubleShortMap that is obtained by flipping the direction of this map and making the associations from value to key.

Exceptions
IllegalStateException:
if the DoubleShortMap contains duplicate values.
Since
9.0
forEachKeyback to summary
public void forEachKey(ShortProcedure procedure)

Iterates through each key in the map, invoking the procedure for each.

Parameters
procedure:ShortProcedure

the procedure to invoke for each key

forEachKeyValueback to summary
public void forEachKeyValue(ShortDoubleProcedure procedure)

Iterates through each key/value pair in the map, invoking the procedure for each.

Parameters
procedure:ShortDoubleProcedure

the procedure to invoke for each key/value pair

getback to summary
public double get(short key)

Retrieves the value associated with the key. If no mapping exists for the key, the default value (usually 0) is returned.

Parameters
key:short

the key

Returns:double

the value associated with the key, or the default value if no such mapping exists

getIfAbsentback to summary
public double getIfAbsent(short key, double ifAbsent)

Retrieves the value associated with the key, returning the specified default value if no such mapping exists.

Parameters
key:short

the key

ifAbsent:double

the default value to return if no mapping exists for key

Returns:double

the value associated with the key, or ifAbsent if no such mapping exists.

getOrThrowback to summary
public double getOrThrow(short key)

Retrieves the value associated with the key, throwing an IllegalStateException if no such mapping exists.

Parameters
key:short

the key

Returns:double

the value associated with the key

Exceptions
IllegalStateException:
if no mapping exists for the key
hashCodeback to summary
public int hashCode()

Follows the same general contract as Map#hashCode().

Annotations
@Override
injectIntoKeyValueback to summary
public default <IV> IV injectIntoKeyValue(IV injectedValue, ObjectShortDoubleToObjectFunction<? super IV, ? extends IV> function)

Implements the injectInto pattern with each key/value pair of the map.

Parameters
injectedValue:IV

value to be injected into the map

function:ObjectShortDoubleToObjectFunction<? super IV, ? extends IV>

to apply to the injected value and key/value pairs

Returns:IV

result of injecting the injectedValue into the map

Since
11.1
keySetback to summary
public MutableShortSet keySet()

Returns a set containing all the keys in this map. The set is backed by the map, so any modifications to the returned set will affect this map.

Returns:MutableShortSet

a mutable set containing the keys in this map

keysViewback to summary
public LazyShortIterable keysView()

Returns a view of the keys in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the keys returned by the iterable.

Returns:LazyShortIterable

a view of the keys in this map

Since
5.0
keyValuesViewback to summary
public RichIterable<ShortDoublePair> keyValuesView()

Returns a view of the key/value pairs in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the pairs returned by the iterable.

Returns:RichIterable<ShortDoublePair>

a view of the keys in this map

Since
5.0
rejectback to summary
public ShortDoubleMap reject(ShortDoublePredicate predicate)

Return a copy of this map containing only the key/value pairs that do not match the predicate.

Parameters
predicate:ShortDoublePredicate

the predicate to determine which key/value pairs in this map should be excluded from the returned map

Returns:ShortDoubleMap

a copy of this map without the matching key/value pairs

selectback to summary
public ShortDoubleMap select(ShortDoublePredicate predicate)

Return a copy of this map containing only the key/value pairs that match the predicate.

Parameters
predicate:ShortDoublePredicate

the predicate to determine which key/value pairs in this map should be included in the returned map

Returns:ShortDoubleMap

a copy of this map with the matching key/value pairs

toImmutableback to summary
public ImmutableShortDoubleMap toImmutable()

Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.

Returns:ImmutableShortDoubleMap

an immutable map that is equivalent to this one

toStringback to summary
public String toString()

Redeclares org.eclipse.collections.api.PrimitiveIterable.toString.

Follows the same general contract as java.util.AbstractMap#toString()

Returns:String

a string representation of this ShortDoubleMap

Annotations
@Override