|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.modello.plugin.java.javasource.JNamedMap
public class JNamedMap
A simple String to Object mapping which preserves order.
Note:
This class is not synchronized. So be careful. :-)
Constructor Summary | |
---|---|
JNamedMap()
Creates a new JNamedMap |
|
JNamedMap(int size)
Creates a new JNamedMap with the given size. |
Method Summary | |
---|---|
Object |
get(int index)
Returns the Object at the given index. |
Object |
get(String name)
Returns the Object associated with the given name. |
String |
getNameByObject(Object obj)
Returns the name associated with the given Object |
Vector<String> |
getNames()
Return a Vector of names |
Vector<Object> |
getObjects()
Return a Vector of Objects |
int |
indexOf(String name)
Returns the index of the Object which has been mapped (associated) with the given name |
void |
put(String name,
Object obj)
Maps (associates) an Object with a name |
Object |
remove(int index)
Removes and returns the Object located at the given index |
Object |
remove(String name)
Removes and returns the Object associated with the given name |
int |
size()
Returns the number of Object associations currently in this named map |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JNamedMap()
public JNamedMap(int size)
size
- the initial size for this NamedMapMethod Detail |
---|
public Object get(String name)
name
- the name to search for
public Object get(int index) throws IndexOutOfBoundsException
index
- the index of the Object to return
IndexOutOfBoundsException
public String getNameByObject(Object obj)
obj
- the Object to search for
public Vector<String> getNames()
public Vector<Object> getObjects()
public int indexOf(String name)
public void put(String name, Object obj)
name
- the name to associate with the given Objectobj
- the Object to be mappedpublic Object remove(int index) throws IndexOutOfBoundsException
name
- the name of the Object to remove
IndexOutOfBoundsException
public Object remove(String name)
name
- the name of the Object to remove
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |