gnu.trove.decorator
Class TLongLongMapDecorator
- java.lang.Object
-
- java.util.AbstractMap<java.lang.Long,java.lang.Long>
-
- gnu.trove.decorator.TLongLongMapDecorator
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Long,java.lang.Long>
public class TLongLongMapDecorator extends java.util.AbstractMap<java.lang.Long,java.lang.Long> implements java.util.Map<java.lang.Long,java.lang.Long>, java.io.Externalizable, java.lang.CloneableWrapper class to make a TLongLongMap conform to the java.util.Map API. This class simply decorates an underlying TLongLongMap and translates the Object-based APIs into their Trove primitive analogs. Note that wrapping and unwrapping primitive values is extremely inefficient. If possible, users of this class should override the appropriate methods in this class and use a table of canonical values. Created: Mon Sep 23 22:07:40 PDT 2002- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor and Description TLongLongMapDecorator()FOR EXTERNALIZATION ONLY!!TLongLongMapDecorator(TLongLongMap map)Creates a wrapper that decorates the specified primitive map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()Empties the map.booleancontainsKey(java.lang.Object key)Checks for the present of key in the keys of the map.booleancontainsValue(java.lang.Object val)Checks for the presence of val in the values of the map.java.util.Set<java.util.Map.Entry<java.lang.Long,java.lang.Long>>entrySet()Returns a Set view on the entries of the map.java.lang.Longget(java.lang.Object key)Retrieves the value for keyTLongLongMapgetMap()Returns a reference to the map wrapped by this decorator.booleanisEmpty()Indicates whether map has any entries.java.lang.Longput(java.lang.Long key, java.lang.Long value)Inserts a key/value pair into the map.voidputAll(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> map)Copies the key/value mappings in map into this map.voidreadExternal(java.io.ObjectInput in)java.lang.Longremove(java.lang.Object key)Deletes a key/value pair from the map.intsize()Returns the number of entries in the map.voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Constructor Detail
-
TLongLongMapDecorator
public TLongLongMapDecorator()
FOR EXTERNALIZATION ONLY!!
-
TLongLongMapDecorator
public TLongLongMapDecorator(TLongLongMap map)
Creates a wrapper that decorates the specified primitive map.- Parameters:
map- the TLongLongMap to wrap.
-
-
Method Detail
-
getMap
public TLongLongMap getMap()
Returns a reference to the map wrapped by this decorator.- Returns:
- the wrapped TLongLongMap instance.
-
put
public java.lang.Long put(java.lang.Long key, java.lang.Long value)Inserts a key/value pair into the map.- Specified by:
putin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
putin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
key- anObjectvaluevalue- anObjectvalue- Returns:
- the previous value associated with key, or Long(0) if none was found.
-
get
public java.lang.Long get(java.lang.Object key)
Retrieves the value for key- Specified by:
getin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
getin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
key- anObjectvalue- Returns:
- the value of key or null if no such mapping exists.
-
clear
public void clear()
Empties the map.- Specified by:
clearin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
clearin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>
-
remove
public java.lang.Long remove(java.lang.Object key)
Deletes a key/value pair from the map.- Specified by:
removein interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
removein classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
key- anObjectvalue- Returns:
- the removed value, or null if it was not found in the map
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.Long,java.lang.Long>> entrySet()
Returns a Set view on the entries of the map.- Specified by:
entrySetin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Specified by:
entrySetin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Returns:
- a
Setvalue
-
containsValue
public boolean containsValue(java.lang.Object val)
Checks for the presence of val in the values of the map.- Specified by:
containsValuein interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
containsValuein classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
val- anObjectvalue- Returns:
- a
booleanvalue
-
containsKey
public boolean containsKey(java.lang.Object key)
Checks for the present of key in the keys of the map.- Specified by:
containsKeyin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
containsKeyin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
key- anObjectvalue- Returns:
- a
booleanvalue
-
size
public int size()
Returns the number of entries in the map.- Specified by:
sizein interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
sizein classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Returns:
- the map's size.
-
isEmpty
public boolean isEmpty()
Indicates whether map has any entries.- Specified by:
isEmptyin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
isEmptyin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Returns:
- true if the map is empty
-
putAll
public void putAll(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> map)
Copies the key/value mappings in map into this map. Note that this will be a deep copy, as storage is by primitive value.- Specified by:
putAllin interfacejava.util.Map<java.lang.Long,java.lang.Long>- Overrides:
putAllin classjava.util.AbstractMap<java.lang.Long,java.lang.Long>- Parameters:
map- aMapvalue
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG