Public Member Functions | |
JNamedMap () | |
JNamedMap (int size) | |
Object | get (String name) |
Object | get (int index) throws IndexOutOfBoundsException |
String | getNameByObject (Object obj) |
Vector | getNames () |
Vector | getObjects () |
int | indexOf (String name) |
void | put (String name, Object obj) |
Object | remove (int index) throws IndexOutOfBoundsException |
Object | remove (String name) |
int | size () |
A simple String to Object mapping which preserves order.
Note: This class is not synchronized. So be careful. :-)
org.exolab.javasource.JNamedMap.JNamedMap | ( | ) |
Creates a new JNamedMap
org.exolab.javasource.JNamedMap.JNamedMap | ( | int | size | ) |
Creates a new JNamedMap with the given size.
size | the initial size for this NamedMap |
Object org.exolab.javasource.JNamedMap.get | ( | String | name | ) |
Returns the Object associated with the given name.
name | the name to search for |
References org.exolab.javasource.JNamedMap.indexOf().
Referenced by org.exolab.javasource.JAnnotationType.addElement(), org.exolab.javasource.JInterface.addField(), org.exolab.javasource.JClass.addField(), org.exolab.javasource.JMethodSignature.addParameter(), org.exolab.javasource.JConstructor.addParameter(), org.exolab.javasource.JAnnotationType.getElement(), org.exolab.javasource.JAnnotationType.getElements(), org.exolab.javasource.JInterface.getField(), org.exolab.javasource.JClass.getField(), org.exolab.javasource.JInterface.getFields(), org.exolab.javasource.JClass.getFields(), org.exolab.javasource.JMethodSignature.getParameter(), org.exolab.javasource.JMethodSignature.getParameterClassNames(), org.exolab.javasource.JMethodSignature.getParameters(), org.exolab.javasource.JConstructor.getParameters(), org.exolab.javasource.JMethodSignature.print(), org.exolab.javasource.JInterface.print(), org.exolab.javasource.JConstructor.print(), org.exolab.javasource.JClass.print(), org.exolab.javasource.JAnnotationType.print(), org.exolab.javasource.JClass.removeField(), org.exolab.javasource.JMethodSignature.toString(), and org.exolab.javasource.JConstructor.toString().
Object org.exolab.javasource.JNamedMap.get | ( | int | index | ) | throws IndexOutOfBoundsException |
Returns the Object at the given index.
index | the index of the Object to return |
String org.exolab.javasource.JNamedMap.getNameByObject | ( | Object | obj | ) |
Returns the name associated with the given Object
obj | the Object to search for |
Vector org.exolab.javasource.JNamedMap.getNames | ( | ) |
Return a Vector of names
Vector org.exolab.javasource.JNamedMap.getObjects | ( | ) |
Return a Vector of Objects
int org.exolab.javasource.JNamedMap.indexOf | ( | String | name | ) |
Returns the index of the Object which has been mapped (associated) with the given name
Referenced by org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JNamedMap.put(), and org.exolab.javasource.JNamedMap.remove().
void org.exolab.javasource.JNamedMap.put | ( | String | name, | |
Object | obj | |||
) |
Maps (associates) an Object with a name
name | the name to associate with the given Object | |
obj | the Object to be mapped |
References org.exolab.javasource.JNamedMap.indexOf().
Referenced by org.exolab.javasource.JAnnotationType.addElement(), org.exolab.javasource.JInterface.addField(), org.exolab.javasource.JClass.addField(), org.exolab.javasource.JMethodSignature.addParameter(), and org.exolab.javasource.JConstructor.addParameter().
Object org.exolab.javasource.JNamedMap.remove | ( | int | index | ) | throws IndexOutOfBoundsException |
Removes and returns the Object located at the given index
name | the name of the Object to remove |
Referenced by org.exolab.javasource.JClass.removeField().
Object org.exolab.javasource.JNamedMap.remove | ( | String | name | ) |
Removes and returns the Object associated with the given name
name | the name of the Object to remove |
References org.exolab.javasource.JNamedMap.indexOf().
int org.exolab.javasource.JNamedMap.size | ( | ) |
Returns the number of Object associations currently in this named map
Referenced by org.exolab.javasource.JAnnotationType.getElements(), org.exolab.javasource.JInterface.getFields(), org.exolab.javasource.JClass.getFields(), org.exolab.javasource.JMethodSignature.getParameterClassNames(), org.exolab.javasource.JMethodSignature.getParameters(), org.exolab.javasource.JConstructor.getParameters(), org.exolab.javasource.JMethodSignature.print(), org.exolab.javasource.JInterface.print(), org.exolab.javasource.JConstructor.print(), org.exolab.javasource.JClass.print(), org.exolab.javasource.JAnnotationType.print(), org.exolab.javasource.JMethodSignature.toString(), and org.exolab.javasource.JConstructor.toString().