public class TSynchronizedShortLongMap extends java.lang.Object implements TShortLongMap, java.io.Serializable
| Constructor and Description |
|---|
TSynchronizedShortLongMap(TShortLongMap m) |
TSynchronizedShortLongMap(TShortLongMap m,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
long |
adjustOrPutValue(short key,
long adjust_amount,
long put_amount)
Adjusts the primitive value mapped to the key if the key is present in the map.
|
boolean |
adjustValue(short key,
long amount)
Adjusts the primitive value mapped to key.
|
void |
clear()
Empties the map.
|
boolean |
containsKey(short key)
Checks for the present of key in the keys of the map.
|
boolean |
containsValue(long value)
Checks for the presence of val in the values of the map.
|
boolean |
equals(java.lang.Object o) |
boolean |
forEachEntry(TShortLongProcedure procedure)
Executes procedure for each key/value entry in the
map.
|
boolean |
forEachKey(TShortProcedure procedure)
Executes procedure for each key in the map.
|
boolean |
forEachValue(TLongProcedure procedure)
Executes procedure for each value in the map.
|
long |
get(short key)
Retrieves the value for key.
|
short |
getNoEntryKey()
Returns the value that will be returned from
TShortLongMap.get(short) or TShortLongMap.put(short, long) if no
entry exists for a given key. |
long |
getNoEntryValue()
Returns the value that will be returned from
TShortLongMap.get(short) or TShortLongMap.put(short, long) if no
entry exists for a given key. |
int |
hashCode() |
boolean |
increment(short key)
Increments the primitive value mapped to key by 1
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
TShortLongIterator |
iterator() |
short[] |
keys()
Returns the keys of the map as an array of short values.
|
short[] |
keys(short[] array)
Returns the keys of the map.
|
TShortSet |
keySet()
Returns the keys of the map as a TShortSet
|
long |
put(short key,
long value)
Inserts a key/value pair into the map.
|
void |
putAll(java.util.Map<? extends java.lang.Short,? extends java.lang.Long> map)
Put all the entries from the given Map into this map.
|
void |
putAll(TShortLongMap map)
Put all the entries from the given map into this map.
|
long |
putIfAbsent(short key,
long value)
Inserts a key/value pair into the map if the specified key is not already
associated with a value.
|
long |
remove(short key)
Deletes a key/value pair from the map.
|
boolean |
retainEntries(TShortLongProcedure procedure)
Retains only those entries in the map for which the procedure
returns a true value.
|
int |
size()
Returns an int value that is the number of elements in the map.
|
java.lang.String |
toString() |
void |
transformValues(TLongFunction function)
Transform the values in this map using function.
|
TLongCollection |
valueCollection()
Returns the values of the map as a TLongCollection
|
long[] |
values()
Returns the values of the map as an array of #e# values.
|
long[] |
values(long[] array)
Returns the values of the map using an existing array.
|
public TSynchronizedShortLongMap(TShortLongMap m)
public TSynchronizedShortLongMap(TShortLongMap m, java.lang.Object mutex)
public int size()
TShortLongMapsize in interface TShortLongMappublic boolean isEmpty()
TShortLongMapisEmpty in interface TShortLongMappublic boolean containsKey(short key)
TShortLongMapcontainsKey in interface TShortLongMappublic boolean containsValue(long value)
TShortLongMapcontainsValue in interface TShortLongMappublic long get(short key)
TShortLongMapget in interface TShortLongMapTShortLongMap.getNoEntryValue()).public long put(short key,
long value)
TShortLongMapput in interface TShortLongMapTShortLongMap.getNoEntryValue()).public long remove(short key)
TShortLongMapremove in interface TShortLongMapkey - an short valueTShortLongMap.getNoEntryValue()).public void putAll(java.util.Map<? extends java.lang.Short,? extends java.lang.Long> map)
TShortLongMapputAll in interface TShortLongMapmap - The Map from which entries will be obtained to put into this map.public void putAll(TShortLongMap map)
TShortLongMapputAll in interface TShortLongMapmap - The map from which entries will be obtained to put into this map.public void clear()
TShortLongMapclear in interface TShortLongMappublic TShortSet keySet()
TShortLongMapkeySet in interface TShortLongMappublic short[] keys()
TShortLongMapkeys in interface TShortLongMappublic short[] keys(short[] array)
TShortLongMapkeys in interface TShortLongMaparray - the array into which the elements of the list are to be stored,
if it is big enough; otherwise, a new array of the same type is
allocated for this purpose.public TLongCollection valueCollection()
TShortLongMapvalueCollection in interface TShortLongMappublic long[] values()
TShortLongMapvalues in interface TShortLongMappublic long[] values(long[] array)
TShortLongMapvalues in interface TShortLongMaparray - the array into which the elements of the list are to be stored,
if it is big enough; otherwise, a new array of the same type is
allocated for this purpose.public TShortLongIterator iterator()
iterator in interface TShortLongMappublic short getNoEntryKey()
TShortLongMapTShortLongMap.get(short) or TShortLongMap.put(short, long) if no
entry exists for a given key. The default value is generally zero, but can be
configured during construction of the collection.getNoEntryKey in interface TShortLongMappublic long getNoEntryValue()
TShortLongMapTShortLongMap.get(short) or TShortLongMap.put(short, long) if no
entry exists for a given key. The default value is generally zero, but can be
configured during construction of the collection.getNoEntryValue in interface TShortLongMappublic long putIfAbsent(short key,
long value)
TShortLongMapputIfAbsent in interface TShortLongMapTShortLongMap.getNoEntryValue()).public boolean forEachKey(TShortProcedure procedure)
TShortLongMapforEachKey in interface TShortLongMapprocedure - a TShortProcedure valuepublic boolean forEachValue(TLongProcedure procedure)
TShortLongMapforEachValue in interface TShortLongMapprocedure - a T#F#Procedure valuepublic boolean forEachEntry(TShortLongProcedure procedure)
TShortLongMapforEachEntry in interface TShortLongMapprocedure - a TOShortLongProcedure valuepublic void transformValues(TLongFunction function)
TShortLongMaptransformValues in interface TShortLongMapfunction - a TLongFunction valuepublic boolean retainEntries(TShortLongProcedure procedure)
TShortLongMapretainEntries in interface TShortLongMapprocedure - determines which entries to keeppublic boolean increment(short key)
TShortLongMapincrement in interface TShortLongMapkey - the key of the value to incrementpublic boolean adjustValue(short key,
long amount)
TShortLongMapadjustValue in interface TShortLongMapkey - the key of the value to incrementamount - the amount to adjust the value by.public long adjustOrPutValue(short key,
long adjust_amount,
long put_amount)
TShortLongMapadjustOrPutValue in interface TShortLongMapkey - the key of the value to incrementadjust_amount - the amount to adjust the value byput_amount - the value put into the map if the key is not presentpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object