public class SmallMap extends Object
Constructor and Description |
---|
SmallMap(int maxElements)
Create a map with the given maximum number of entries.
|
Modifier and Type | Method and Description |
---|---|
int |
addObject(int id,
Object o)
Add an object to the map.
|
void |
freeObject(int id)
Remove an object from the map.
|
Object |
getObject(int id,
boolean ifAvailable)
Get an object from the map if it is stored.
|
public SmallMap(int maxElements)
maxElements
- the maximum number of entriespublic int addObject(int id, Object o)
id
- the object ido
- the objectpublic void freeObject(int id)
id
- the id of the object to removepublic Object getObject(int id, boolean ifAvailable)
id
- the id of the objectifAvailable
- only return it if available, otherwise return nullDbException
- if isAvailable is false and the object has not been
foundCopyright © 2012 JBoss by Red Hat. All Rights Reserved.