xxl.collections
Class MapContainer
java.lang.Object
|
+--xxl.collections.Container
|
+--xxl.collections.MapContainer
- public class MapContainer
- extends Container
The MapContainer is a Container that stores elements in a
Map.
TODO
|
Field Summary |
protected int |
counter
|
static Function |
FACTORY_METHOD
A factory method to create a new MapContainer. |
protected java.util.Map |
map
The Map used to store entries. |
|
Method Summary |
void |
clear()
Removes all elements from the Container. |
boolean |
contains(java.lang.Object id)
Returns true if the Continaer contains an object for the given Id. |
java.lang.Object |
get(java.lang.Object id,
boolean unfix)
Returns the Object with the given Id. |
java.util.Iterator |
ids()
Returns a Cursor pointing to the ids of this Container. |
java.lang.Object |
insert(java.lang.Object object,
boolean unfix)
Inserts an Object into this Container. |
void |
remove(java.lang.Object id)
Removes the Object with the given Id. |
int |
size()
Returns the number of elements of this Container. |
void |
update(java.lang.Object id,
java.lang.Object object,
boolean unfix)
Updates an existing (id,*)-entry with (id,object). |
| Methods inherited from class xxl.collections.Container |
close,
flush,
flush,
get,
getAll,
getAll,
insert,
insertAll,
insertAll,
objects,
removeAll,
unfix,
unfixAll,
update,
updateAll,
updateAll,
updateAll,
updateAll |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
FACTORY_METHOD
public static final Function FACTORY_METHOD
- A factory method to create a new MapContainer.
It may be invoked with or without a given array.
(see contract for FACTORY_METHOD in class Container)
counter
protected int counter
map
protected java.util.Map map
- The Map used to store entries.
MapContainer
public MapContainer(java.util.Map map)
MapContainer
public MapContainer()
clear
public void clear()
- Removes all elements from the Container.
- Overrides:
- clear in class Container
contains
public boolean contains(java.lang.Object id)
- Returns true if the Continaer contains an object for the given Id.
- Overrides:
- contains in class Container
get
public java.lang.Object get(java.lang.Object id,
boolean unfix)
throws java.util.NoSuchElementException
- Returns the Object with the given Id.
- Overrides:
- get in class Container
ids
public java.util.Iterator ids()
- Returns a Cursor pointing to the ids of this Container.
- Overrides:
- ids in class Container
insert
public java.lang.Object insert(java.lang.Object object,
boolean unfix)
- Inserts an Object into this Container.
- Returns:
- the Id of the Object is returned
- Overrides:
- insert in class Container
remove
public void remove(java.lang.Object id)
throws java.util.NoSuchElementException
- Removes the Object with the given Id.
- Overrides:
- remove in class Container
size
public int size()
- Returns the number of elements of this Container.
- Overrides:
- size in class Container
update
public void update(java.lang.Object id,
java.lang.Object object,
boolean unfix)
throws java.util.NoSuchElementException
- Updates an existing (id,*)-entry with (id,object).
- Parameters:
id - the id of the entryobject - the new Object for that entry- Overrides:
- update in class Container