cern.colt.map
Class AbstractMap
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.colt.map.AbstractMap
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- AbstractDoubleIntMap, AbstractDoubleIntMap, AbstractDoubleLongMap, AbstractFloatIntMap, AbstractFloatLongMap, AbstractIntDoubleMap, AbstractIntDoubleMap, AbstractIntFloatMap, AbstractIntIntMap, AbstractIntIntMap, AbstractIntLongMap, AbstractIntObjectMap, AbstractIntObjectMap, AbstractLongDoubleMap, AbstractLongFloatMap, AbstractLongIntMap, AbstractLongLongMap, AbstractLongObjectMap, AbstractLongObjectMap
public abstract class AbstractMap extends PersistentObject
Abstract base class for hash maps holding objects or primitive data types such asint,float, etc. as keys and/or values. First see the package summary and javadoc tree view to get the broad picture.Note that implementations are not synchronized.
- See Also:
HashMap, Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidclear()Removes all (key,value) associations from the receiver.voidensureCapacity(int minCapacity)Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.booleanisEmpty()Returns true if the receiver contains no (key,value) associations.intsize()Returns the number of (key,value) associations currently contained.voidtrimToSize()Trims the capacity of the receiver to be the receiver's current size.-
Methods inherited from class cern.colt.PersistentObject
clone
-
-
-
-
Method Detail
-
clear
public abstract void clear()
Removes all (key,value) associations from the receiver.
-
ensureCapacity
public void ensureCapacity(int minCapacity)
Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver.This method never need be called; it is for performance tuning only. Calling this method before put()ing a large number of associations boosts performance, because the receiver will grow only once instead of potentially many times.
This default implementation does nothing. Override this method if necessary.
- Parameters:
minCapacity- the desired minimum capacity.
-
isEmpty
public boolean isEmpty()
Returns true if the receiver contains no (key,value) associations.- Returns:
- true if the receiver contains no (key,value) associations.
-
size
public int size()
Returns the number of (key,value) associations currently contained.- Returns:
- the number of (key,value) associations currently contained.
-
trimToSize
public void trimToSize()
Trims the capacity of the receiver to be the receiver's current size. Releases any superfluous internal memory. An application can use this operation to minimize the storage of the receiver.This default implementation does nothing. Override this method if necessary.
-
-
DMelt 3.0 © DataMelt by jWork.ORG