public class JNamedMap
extends java.lang.Object
Constructor and Description |
---|
JNamedMap()
Creates a new JNamedMap
|
JNamedMap(int size)
Creates a new JNamedMap with the given size.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(int index)
Returns the Object at the given index.
|
java.lang.Object |
get(java.lang.String name)
Returns the Object associated with the given name.
|
java.lang.String |
getNameByObject(java.lang.Object obj)
Returns the name associated with the given Object
|
java.util.Vector<java.lang.String> |
getNames()
Return a Vector of names
|
java.util.Vector<java.lang.Object> |
getObjects()
Return a Vector of Objects
|
int |
indexOf(java.lang.String name)
Returns the index of the Object which has been
mapped (associated) with the given name
|
void |
put(java.lang.String name,
java.lang.Object obj)
Maps (associates) an Object with a name
|
java.lang.Object |
remove(int index)
Removes and returns the Object located at the given index
|
java.lang.Object |
remove(java.lang.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
|
public JNamedMap()
public JNamedMap(int size)
size
- the initial size for this NamedMappublic java.lang.Object get(java.lang.String name)
name
- the name to search forpublic java.lang.Object get(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the Object to returnjava.lang.IndexOutOfBoundsException
public java.lang.String getNameByObject(java.lang.Object obj)
obj
- the Object to search forpublic java.util.Vector<java.lang.String> getNames()
public java.util.Vector<java.lang.Object> getObjects()
public int indexOf(java.lang.String name)
public void put(java.lang.String name, java.lang.Object obj)
name
- the name to associate with the given Objectobj
- the Object to be mappedpublic java.lang.Object remove(int index) throws java.lang.IndexOutOfBoundsException
name
- the name of the Object to removejava.lang.IndexOutOfBoundsException
public java.lang.Object remove(java.lang.String name)
name
- the name of the Object to removepublic int size()