|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.mapping.handlers.J2MapHandler
public final class J2MapHandler
A Map handler for adding and retreiving key-value pairs from A map. A map handler is instantiated only once, must be thread safe and not use any synchronization.
Nested Class Summary | |
---|---|
(package private) static class |
J2MapHandler.IteratorEnumerator
Enumerator for an iterator. |
Constructor Summary | |
---|---|
J2MapHandler()
|
Method Summary | |
---|---|
void |
clear(java.lang.Object map)
Clears the map of all key-value pairs. |
java.lang.Object |
create()
Creates a new Instance of the map represented by this MapHandler. |
java.util.Enumeration |
elements(java.lang.Object map)
Returns an enumeration of all the objects in the Map. |
java.lang.Object |
get(java.lang.Object map,
java.lang.Object key)
Returns the object associated with the given key. |
java.util.Enumeration |
keys(java.lang.Object map)
Returns an enumeration of all the keys in the Map. |
java.lang.Object |
put(java.lang.Object map,
java.lang.Object key,
java.lang.Object object)
Adds the given key-value pair to the map. |
int |
size(java.lang.Object map)
Returns the number of elements (key-value) in the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public J2MapHandler()
Method Detail |
---|
public java.lang.Object create()
create
in interface MapHandler
public java.lang.Object put(java.lang.Object map, java.lang.Object key, java.lang.Object object) throws java.lang.ClassCastException
put
in interface MapHandler
map
- the map, null if no map has been created yet.key
- the key for the object.object
- the object to add to the map.
java.lang.ClassCastException
- The MapHandler does not
support maps of the given type.public java.util.Enumeration elements(java.lang.Object map) throws java.lang.ClassCastException
elements
in interface MapHandler
map
- The map instance for which to return the enumeration
of elements for.
java.lang.ClassCastException
- The MapHandler does not
support collections of this typepublic java.util.Enumeration keys(java.lang.Object map) throws java.lang.ClassCastException
keys
in interface MapHandler
map
- The map instance for which to return the enumeration
of keys.
java.lang.ClassCastException
- The MapHandler does not
support collections of this typepublic int size(java.lang.Object map) throws java.lang.ClassCastException
size
in interface MapHandler
map
- the map.
java.lang.ClassCastException
- The MapHandler does not
support collections of the given type.public void clear(java.lang.Object map) throws java.lang.ClassCastException
clear
in interface MapHandler
map
- the map to clear.
java.lang.ClassCastException
- The MapHandler does not
support collections of the given type.public java.lang.Object get(java.lang.Object map, java.lang.Object key) throws java.lang.ClassCastException
get
in interface MapHandler
map
- the map to return the object from.key
- the key for the object.
java.lang.ClassCastException
- The MapHandler does not
support maps of the given type.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |