|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ShortShortMap
A Map specialization with short keys and short values.
ShortShortMapFactory| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
short |
addValue(short key,
short addition)
Adds the given addition value to the value associated with the specified key,
or default value if this map contains no mapping for the key, and associates the resulting
value with the key. |
short |
addValue(short key,
short addition,
short defaultValue)
Adds the given addition value to the value associated with the specified key,
or defaultValue if this map contains no mapping for the key, and associates
the resulting value with the key. |
short |
compute(short key,
ShortShortToShortFunction remappingFunction)
Attempts to compute a mapping for the specified key and its current mapped value (or default value if there is no current mapping). |
short |
computeIfAbsent(short key,
ShortUnaryOperator mappingFunction)
If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map . |
short |
computeIfPresent(short key,
ShortShortToShortFunction remappingFunction)
If the value for the specified key is present, attempts to compute a new mapping given the key and its current mapped value. |
boolean |
containsKey(Object key)
Deprecated. Use specialization containsKey(short) instead |
boolean |
containsKey(short key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Deprecated. Use specialization containsValue(short) instead |
boolean |
containsValue(short value)
Returns true if this map maps one or more keys to the specified value. |
ShortShortCursor |
cursor()
Returns a new cursor over the entries of this map. |
short |
defaultValue()
Returns the default value of this map, which is used instead of null
in primitive specialization methods, when the key is absent in the map. |
ObjSet<Map.Entry<Short,Short>> |
entrySet()
|
void |
forEach(ShortShortConsumer action)
Performs the given action on each entry in this map until all entries
have been processed or the action throws an Exception. |
boolean |
forEachWhile(ShortShortPredicate predicate)
Checks the given predicate on each entry in this map until all entries
have been processed or the predicate returns false for some entry,
or throws an Exception. |
Short |
get(Object key)
Deprecated. Use specialization get(short) instead |
short |
get(short key)
Returns the value to which the specified key is mapped, or default value if this map
contains no mapping for the key. |
Short |
getOrDefault(Object key,
Short defaultValue)
Deprecated. Use specialization getOrDefault(short, short) instead |
short |
getOrDefault(short key,
short defaultValue)
Returns the value to which the specified key is mapped, or defaultValue if this map
contains no mapping for the key. |
ShortSet |
keySet()
|
short |
merge(short key,
short value,
ShortBinaryOperator remappingFunction)
If the specified key is not already associated with a value, associates it with the given value, otherwise, replaces the value with the results of the given remapping function. |
short |
put(short key,
short value)
Associates the specified value with the specified key in this map (optional operation). |
Short |
put(Short key,
Short value)
Deprecated. Use specialization put(short, short) instead |
short |
putIfAbsent(short key,
short value)
If the specified key is not already associated with a value, associates it with the given value and returns default value, else returns the current value. |
Short |
putIfAbsent(Short key,
Short value)
Deprecated. Use specialization putIfAbsent(short, short) instead |
Short |
remove(Object key)
Deprecated. Use specialization remove(short) instead |
boolean |
remove(Object key,
Object value)
Deprecated. Use specialization remove(short, short) instead |
short |
remove(short key)
Removes the mapping for a key from this map if it is present (optional operation). |
boolean |
remove(short key,
short value)
Removes the entry for the specified key only if it is currently mapped to the specified value. |
boolean |
removeIf(ShortShortPredicate filter)
Removes all of the entries of this collection that satisfy the given predicate. |
short |
replace(short key,
short value)
Replaces the entry for the specified key only if it is currently mapped to some value. |
Short |
replace(Short key,
Short value)
Deprecated. Use specialization replace(short, short) instead |
boolean |
replace(short key,
short oldValue,
short newValue)
Replaces the entry for the specified key only if currently mapped to the specified value. |
boolean |
replace(Short key,
Short oldValue,
Short newValue)
Deprecated. Use specialization replace(short, short, short) instead |
void |
replaceAll(ShortShortToShortFunction function)
Replaces each entry's value with the result of invoking the given function on that entry, in the order entries are returned by an entry set iterator, until all entries have been processed or the function throws an exception. |
ShortCollection |
values()
|
| Methods inherited from interface java.util.Map |
|---|
clear, equals, hashCode, isEmpty, putAll, size |
| Methods inherited from interface net.openhft.collect.Container |
|---|
clear, ensureCapacity, isEmpty, shrink, size, sizeAsLong |
| Method Detail |
|---|
short defaultValue()
null
in primitive specialization methods, when the key is absent in the map.
ShortShortMapFactory.withDefaultValue(short)@Deprecated boolean containsKey(Object key)
containsKey(short) instead
containsKey in interface Map<Short,Short>boolean containsKey(short key)
true if this map contains a mapping for the specified key.
key - the short key whose presence in this map is to be tested
true if this map contains a mapping for the specified key@Deprecated boolean containsValue(Object value)
containsValue(short) instead
containsValue in interface Map<Short,Short>boolean containsValue(short value)
true if this map maps one or more keys to the specified value. This operation
will probably require time linear in the map size for most implementations
of the ShortShortMap interface.
value - the short value whose presence in this map is to be tested
true if this map maps one or more keys to the specified value@Nullable @Deprecated Short get(Object key)
get(short) instead
get in interface Map<Short,Short>short get(short key)
default value if this map
contains no mapping for the key.
key - the key whose associated value is to be returned
default value if this map
contains no mapping for the key
@Deprecated
Short getOrDefault(Object key,
Short defaultValue)
getOrDefault(short, short) instead
defaultValue if this map contains no mapping for the key.
key - the key whose associated value is to be returneddefaultValue - the default mapping of the key
defaultValue if this map contains no mapping for the key
short getOrDefault(short key,
short defaultValue)
defaultValue if this map
contains no mapping for the key.
key - the key whose associated value is to be returned
defaultValue if this map contains no mapping for the key
void forEach(@Nonnull
ShortShortConsumer action)
action on each entry in this map until all entries
have been processed or the action throws an Exception.
Exceptions thrown by the action are relayed to the caller. The entries
will be processed in the same order as the entry set iterator unless that
order is unspecified in which case implementations may use an order which
differs from the entry set iterator.
action - The action to be performed for each entry
boolean forEachWhile(@Nonnull
ShortShortPredicate predicate)
predicate on each entry in this map until all entries
have been processed or the predicate returns false for some entry,
or throws an Exception. Exceptions thrown by the predicate are relayed to the caller.
The entries will be processed in the same order as the entry set iterator unless that order is unspecified in which case implementations may use an order which differs from the entry set iterator.
If the map is empty, this method returns true immediately.
predicate - the predicate to be checked for each entry
true if the predicate returned true for all entries of the map,
false if it returned false for the entry@Nonnull ShortShortCursor cursor()
@Nonnull ShortSet keySet()
keySet in interface Map<Short,Short>@Nonnull ShortCollection values()
values in interface Map<Short,Short>@Nonnull ObjSet<Map.Entry<Short,Short>> entrySet()
entrySet in interface Map<Short,Short>
@Deprecated
Short put(Short key,
Short value)
put(short, short) instead
put in interface Map<Short,Short>
short put(short key,
short value)
m is said to contain a mapping for a key k
if and only if m.containsKey(k) would return true.)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
key, or default value if there was
no mapping for key. (A default value return can also indicate that the map
previously associated default value with key.)
UnsupportedOperationException - if the put operation
is not supported by this map
IllegalArgumentException - if some property of a specified key
or value prevents it from being stored in this map
@Nullable
@Deprecated
Short putIfAbsent(Short key,
Short value)
putIfAbsent(short, short) instead
null, else returns the current value.
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
null if there was no mapping for the key.
(A null return can also indicate that the map
previously associated null with the key,
if the implementation supports null values.)
UnsupportedOperationException - if the put operation
is not supported by this map
ClassCastException - if the key or value is of an inappropriate type for this map
NullPointerException - if the specified key or value is null
IllegalArgumentException - if some property of the specified key
or value prevents it from being stored in this map
short putIfAbsent(short key,
short value)
default value, else returns the current value.
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
default value
if there was no mapping for the key. (A default value return
can also indicate that the map previously associated default value
with the key, if the implementation supports such values.)
UnsupportedOperationException - if the put operation
is not supported by this map
IllegalArgumentException - if some property of a specified key
or value prevents it from being stored in this map
short compute(short key,
@Nonnull
ShortShortToShortFunction remappingFunction)
default value if there is no current mapping).
If the function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedremappingFunction - the function to compute a value
UnsupportedOperationException - if the put operation
is not supported by this map
short computeIfAbsent(short key,
@Nonnull
ShortUnaryOperator mappingFunction)
If the function itself throws an (unchecked) exception, the exception is rethrown, and no mapping is recorded.
key - key with which the specified value is to be associatedmappingFunction - the function to compute a value
UnsupportedOperationException - if the put operation
is not supported by this map
short computeIfPresent(short key,
@Nonnull
ShortShortToShortFunction remappingFunction)
If the function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedremappingFunction - the function to compute a value
UnsupportedOperationException - if the put operation
is not supported by this map
short merge(short key,
short value,
@Nonnull
ShortBinaryOperator remappingFunction)
If the remappingFunction itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedvalue - the value to use if absentremappingFunction - the function to recompute a value if present
NullPointerException - if the remappingFunction is null
UnsupportedOperationException - if the put operation
is not supported by this map
short addValue(short key,
short addition)
addition value to the value associated with the specified key,
or default value if this map contains no mapping for the key, and associates the resulting
value with the key.
key - the key to which value add the given valueaddition - the value to add
UnsupportedOperationException - if the put operation
is not supported by this map
short addValue(short key,
short addition,
short defaultValue)
addition value to the value associated with the specified key,
or defaultValue if this map contains no mapping for the key, and associates
the resulting value with the key.
This version of addValue(short, short) is useful if you want to count
values from the different initial value, than the default value
of this map.
key - the key to which value add the given valueaddition - the value to adddefaultValue - the value to be used if the map contains no mapping for the given key
UnsupportedOperationException - if the put operation
is not supported by this map
@Nullable
@Deprecated
Short replace(Short key,
Short value)
replace(short, short) instead
key - key with which the specified value is associatedvalue - value to be associated with the specified key
null if there was
no mapping for the key.
UnsupportedOperationException - if the put operation
is not supported by this map
NullPointerException - if the specified key or value is null
IllegalArgumentException - if some property of the specified value
prevents it from being stored in this map
short replace(short key,
short value)
key - key with which the specified value is associatedvalue - value to be associated with the specified key
default value if there was no mapping for the key.
(A default value return can also indicate that the map
previously associated default value with the key,
if the implementation supports such values.)
IllegalArgumentException - if some property of a specified key
or value prevents it from being stored in this map
UnsupportedOperationException - if the put operation
is not supported by this map
@Deprecated
boolean replace(Short key,
Short oldValue,
Short newValue)
replace(short, short, short) instead
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified key
true if the value was replaced
UnsupportedOperationException - if the put operation
is not supported by this map
NullPointerException - if the specified key or value is null
IllegalArgumentException - if some property of the specified value
prevents it from being stored in this map
boolean replace(short key,
short oldValue,
short newValue)
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified key
true if the value was replaced
IllegalArgumentException - if some property of a specified key
or value prevents it from being stored in this map
UnsupportedOperationException - if the put operation
is not supported by this map
void replaceAll(@Nonnull
ShortShortToShortFunction function)
function - the function to apply to each entry
UnsupportedOperationException - if the set operation
is not supported by this map's entry set iterator
IllegalArgumentException - if some property of a replacement value
prevents it from being stored in this map (optional restriction)@Nullable @Deprecated Short remove(Object key)
remove(short) instead
remove in interface Map<Short,Short>short remove(short key)
Returns the value to which this map previously associated the key, or default value
if the map contained no mapping for the key.
A return value of default value does not necessarily indicate that the map
contained no mapping for the key; it's also possible that the map
explicitly mapped the key to default value.
The map will not contain a mapping for the specified key once the call returns.
key - key whose mapping is to be removed from the map
key, or default value if there was
no mapping for key
UnsupportedOperationException - if the remove operation
is not supported by this map
@Deprecated
boolean remove(Object key,
Object value)
remove(short, short) instead
key - key with which the specified value is associatedvalue - value expected to be associated with the specified key
true if the value was removed
NullPointerException - if the specified key or value is null
UnsupportedOperationException - if the remove operation
is not supported by this map
boolean remove(short key,
short value)
key - key with which the specified value is associatedvalue - value expected to be associated with the specified key
true if the value was removed
UnsupportedOperationException - if the remove operation
is not supported by this map
boolean removeIf(@Nonnull
ShortShortPredicate filter)
filter - a predicate which returns true for elements to be removed
true if any elements were removed
NullPointerException - if the specified filter is null
UnsupportedOperationException - if elements cannot be removed from this collection.
Implementations may throw this exception if a matching element cannot be removed
or if, in general, removal is not supported.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||