public class TSynchronizedObjectByteMap<K> extends java.lang.Object implements TObjectByteMap<K>, java.io.Serializable
| Constructor and Description |
|---|
TSynchronizedObjectByteMap(TObjectByteMap<K> m) |
TSynchronizedObjectByteMap(TObjectByteMap<K> m,
java.lang.Object mutex) |
| Modifier and Type | Method and Description |
|---|---|
byte |
adjustOrPutValue(K key,
byte adjust_amount,
byte put_amount)
Adds an amount to the primitive value mapped to the key if the key is present in
the map.
|
boolean |
adjustValue(K key,
byte amount)
Adds an amount to the primitive value mapped to key.
|
void |
clear()
Removes all of the mappings from this map (optional operation).
|
boolean |
containsKey(java.lang.Object key)
Checks for the present of key in the keys of the map.
|
boolean |
containsValue(byte value)
Checks for the presence of val in the values of the map.
|
boolean |
equals(java.lang.Object o)
Compares the specified object with this map for equality.
|
boolean |
forEachEntry(TObjectByteProcedure<? super K> procedure)
Executes procedure for each key/value entry in the
map.
|
boolean |
forEachKey(TObjectProcedure<? super K> procedure)
Executes procedure for each key in the map.
|
boolean |
forEachValue(TByteProcedure procedure)
Executes procedure for each value in the map.
|
byte |
get(java.lang.Object key)
Retrieves the value for key.
|
byte |
getNoEntryValue()
Returns the value that will be returned from
TObjectByteMap.get(java.lang.Object) or TObjectByteMap.put(K, byte) if no
entry exists for a given key. |
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
increment(K key)
Increments the primitive value mapped to key by 1
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
TObjectByteIterator<K> |
iterator()
Returns a TObjectByteIterator with access to this map's keys and values.
|
java.lang.Object[] |
keys()
Returns a copy of the keys of the map as an array.
|
K[] |
keys(K[] array)
Returns a copy of the keys of the map as an array.
|
java.util.Set<K> |
keySet()
Returns a
Set view of the keys contained in this map. |
byte |
put(K key,
byte value)
Inserts a key/value pair into the map.
|
void |
putAll(java.util.Map<? extends K,? extends java.lang.Byte> map)
Copies all of the mappings from the specified map to this map
(optional operation).
|
void |
putAll(TObjectByteMap<? extends K> map)
Put all the entries from the given map into this map.
|
byte |
putIfAbsent(K key,
byte value)
Inserts a key/value pair into the map if the specified key is not already
associated with a value.
|
byte |
remove(java.lang.Object key)
Deletes a key/value pair from the map.
|
boolean |
retainEntries(TObjectByteProcedure<? super K> procedure)
Retains only those entries in the map for which the procedure
returns a true value.
|
int |
size()
Returns the number of key-value mappings in this map.
|
java.lang.String |
toString() |
void |
transformValues(TByteFunction function)
Transform the values in this map using function.
|
TByteCollection |
valueCollection()
Returns a
TByteCollection view of the values contained in this map. |
byte[] |
values()
Returns the values of the map as an array of byte values.
|
byte[] |
values(byte[] array)
Returns the values of the map using an existing array.
|
public TSynchronizedObjectByteMap(TObjectByteMap<K> m)
public TSynchronizedObjectByteMap(TObjectByteMap<K> m, java.lang.Object mutex)
public int size()
TObjectByteMapsize in interface TObjectByteMap<K>public boolean isEmpty()
TObjectByteMapisEmpty in interface TObjectByteMap<K>public boolean containsKey(java.lang.Object key)
TObjectByteMapcontainsKey in interface TObjectByteMap<K>public boolean containsValue(byte value)
TObjectByteMapcontainsValue in interface TObjectByteMap<K>public byte get(java.lang.Object key)
TObjectByteMapget in interface TObjectByteMap<K>TObjectByteMap.getNoEntryValue()).public byte put(K key, byte value)
TObjectByteMapput in interface TObjectByteMap<K>TObjectByteMap.getNoEntryValue()).public byte remove(java.lang.Object key)
TObjectByteMapremove in interface TObjectByteMap<K>key - an #k# valueTObjectByteMap.getNoEntryValue()).public void putAll(java.util.Map<? extends K,? extends java.lang.Byte> map)
TObjectByteMapput(k, v) on this map once
for each mapping from key k to value v in the
specified map. The behavior of this operation is undefined if the
specified map is modified while the operation is in progress.putAll in interface TObjectByteMap<K>map - mappings to be stored in this mappublic void putAll(TObjectByteMap<? extends K> map)
TObjectByteMapputAll in interface TObjectByteMap<K>map - The map from which entries will be obtained to put into this map.public void clear()
TObjectByteMapclear in interface TObjectByteMap<K>public java.util.Set<K> keySet()
TObjectByteMapSet view of the keys contained in this map.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. If the map is modified
while an iteration over the set is in progress (except through
the iterator's own remove operation), the results of
the iteration are undefined. The set supports element removal,
which removes the corresponding mapping from the map, via the
Iterator.remove, Set.remove,
removeAll, retainAll, and clear
operations. It does not support the add or addAll
operations.keySet in interface TObjectByteMap<K>public java.lang.Object[] keys()
TObjectByteMapkeys in interface TObjectByteMap<K>public K[] keys(K[] array)
TObjectByteMapkeys in interface TObjectByteMap<K>array - 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 TByteCollection valueCollection()
TObjectByteMapTByteCollection view of the values contained in this map.
The collection is backed by the map, so changes to the map are
reflected in the collection, and vice-versa. If the map is
modified while an iteration over the collection is in progress
(except through the iterator's own remove operation),
the results of the iteration are undefined. The collection
supports element removal, which removes the corresponding
mapping from the map, via the TByteIterator.remove,
TByteCollection.remove, removeAll,
retainAll and clear operations. It does not
support the add or addAll operations.valueCollection in interface TObjectByteMap<K>public byte[] values()
TObjectByteMapvalues in interface TObjectByteMap<K>public byte[] values(byte[] array)
TObjectByteMapvalues in interface TObjectByteMap<K>array - 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 TObjectByteIterator<K> iterator()
TObjectByteMapiterator in interface TObjectByteMap<K>public byte getNoEntryValue()
TObjectByteMapTObjectByteMap.get(java.lang.Object) or TObjectByteMap.put(K, byte) 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 TObjectByteMap<K>public byte putIfAbsent(K key, byte value)
TObjectByteMapputIfAbsent in interface TObjectByteMap<K>key - key with which the specified value is to be associatedvalue - an byte value to be associated with the specified keyTObjectByteMap.getNoEntryValue()).public boolean forEachKey(TObjectProcedure<? super K> procedure)
TObjectByteMapforEachKey in interface TObjectByteMap<K>procedure - a TObjectProcedure valuepublic boolean forEachValue(TByteProcedure procedure)
TObjectByteMapforEachValue in interface TObjectByteMap<K>procedure - a TByteProcedure valuepublic boolean forEachEntry(TObjectByteProcedure<? super K> procedure)
TObjectByteMapforEachEntry in interface TObjectByteMap<K>procedure - a TOObjectByteProcedure valuepublic void transformValues(TByteFunction function)
TObjectByteMaptransformValues in interface TObjectByteMap<K>function - a TByteFunction valuepublic boolean retainEntries(TObjectByteProcedure<? super K> procedure)
TObjectByteMapretainEntries in interface TObjectByteMap<K>procedure - determines which entries to keeppublic boolean increment(K key)
TObjectByteMapincrement in interface TObjectByteMap<K>key - the key of the value to incrementpublic boolean adjustValue(K key, byte amount)
TObjectByteMapadjustValue in interface TObjectByteMap<K>key - the key of the value to incrementamount - the amount to add to the value; may be positive, zero, or negativeTObjectByteMap.adjustOrPutValue(Object, byte, byte)public byte adjustOrPutValue(K key, byte adjust_amount, byte put_amount)
TObjectByteMapadjustOrPutValue in interface TObjectByteMap<K>key - the key of the value to incrementadjust_amount - the amount to add to the value; may be positive, zero,
or negativeput_amount - the value put into the map if the key is not presentpublic boolean equals(java.lang.Object o)
TObjectByteMapequals in interface TObjectByteMap<K>equals in class java.lang.Objecto - object to be compared for equality with this mappublic int hashCode()
TObjectByteMapObject.hashCode().hashCode in interface TObjectByteMap<K>hashCode in class java.lang.ObjectObject.equals(Object),
TObjectByteMap.equals(Object)public java.lang.String toString()
toString in class java.lang.Object