org.matheclipse.core.util
Class OpenIntToIExprHashMap
- java.lang.Object
-
- org.matheclipse.core.util.OpenIntToIExprHashMap
-
- Type Parameters:
T- the type of the objects
- All Implemented Interfaces:
- java.io.Serializable
public class OpenIntToIExprHashMap extends java.lang.Object implements java.io.SerializableOpen addressed map from int to IExpr.This class provides a dedicated map from integers to IExprs with a much smaller memory overhead than standard
java.util.Map.This class is not synchronized. The specialized iterators returned by
iterator()are fail-fast: they throw aConcurrentModificationExceptionwhen they detect the map has been modified during iteration.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classOpenIntToIExprHashMap.IteratorIterator class for the map.
-
Constructor Summary
Constructors Constructor and Description OpenIntToIExprHashMap()Build an empty map with default size and using zero for missing entries.OpenIntToIExprHashMap(int expectedSize)Build an empty map with specified size.OpenIntToIExprHashMap(OpenIntToIExprHashMap source)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancontainsKey(int key)Check if a value is associated with a key.IExprget(int key)Get the stored value associated with the given keyOpenIntToIExprHashMap.Iteratoriterator()Get an iterator over map elements.IExprput(int key, IExpr value)Put a value associated with a key in the map.IExprremove(int key)Remove the value associated with a key.intsize()Get the number of elements stored in the map.
-
-
-
Constructor Detail
-
OpenIntToIExprHashMap
public OpenIntToIExprHashMap()
Build an empty map with default size and using zero for missing entries.- Parameters:
field- field to which the elements belong
-
OpenIntToIExprHashMap
public OpenIntToIExprHashMap(int expectedSize)
Build an empty map with specified size.- Parameters:
field- field to which the elements belongexpectedSize- expected number of elements in the mapmissingEntries- value to return when a missing entry is fetched
-
OpenIntToIExprHashMap
public OpenIntToIExprHashMap(OpenIntToIExprHashMap source)
Copy constructor.- Parameters:
source- map to copy
-
-
Method Detail
-
get
public IExpr get(int key)
Get the stored value associated with the given key- Parameters:
key- key associated with the data- Returns:
- data associated with the key
-
containsKey
public boolean containsKey(int key)
Check if a value is associated with a key.- Parameters:
key- key to check- Returns:
- true if a value is associated with key
-
iterator
public OpenIntToIExprHashMap.Iterator iterator()
Get an iterator over map elements.The specialized iterators returned are fail-fast: they throw a
ConcurrentModificationExceptionwhen they detect the map has been modified during iteration.- Returns:
- iterator over the map elements
-
size
public int size()
Get the number of elements stored in the map.- Returns:
- number of elements stored in the map
-
remove
public IExpr remove(int key)
Remove the value associated with a key.- Parameters:
key- key to which the value is associated- Returns:
- removed value
-
-
DMelt 3.0 © DataMelt by jWork.ORG