Class JNamedMap
- java.lang.Object
-
- org.codehaus.modello.plugin.java.javasource.JNamedMap
-
@Deprecated public class JNamedMap extends java.lang.Object
Deprecated.useLinkedHashMap
insteadA simple String to Object mapping which preserves order.
Note: This class is not synchronized. So be careful. :-)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
get(int index)
Deprecated.Returns the Object at the given index.java.lang.Object
get(java.lang.String name)
Deprecated.Returns the Object associated with the given name.java.lang.String
getNameByObject(java.lang.Object obj)
Deprecated.Returns the name associated with the given Objectjava.util.Vector<java.lang.String>
getNames()
Deprecated.Return a Vector of namesjava.util.Vector<java.lang.Object>
getObjects()
Deprecated.Return a Vector of Objectsint
indexOf(java.lang.String name)
Deprecated.Returns the index of the Object which has been mapped (associated) with the given namevoid
put(java.lang.String name, java.lang.Object obj)
Deprecated.Maps (associates) an Object with a namejava.lang.Object
remove(int index)
Deprecated.Removes and returns the Object located at the given indexjava.lang.Object
remove(java.lang.String name)
Deprecated.Removes and returns the Object associated with the given nameint
size()
Deprecated.Returns the number of Object associations currently in this named map
-
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.String name)
Deprecated.Returns the Object associated with the given name.- Parameters:
name
- the name to search for- Returns:
- the Object associated with the given name
-
get
public java.lang.Object get(int index) throws java.lang.IndexOutOfBoundsException
Deprecated.Returns the Object at the given index.- Parameters:
index
- the index of the Object to return- Returns:
- the Object at the given index
- Throws:
java.lang.IndexOutOfBoundsException
-
getNameByObject
public java.lang.String getNameByObject(java.lang.Object obj)
Deprecated.Returns the name associated with the given Object- Parameters:
obj
- the Object to search for- Returns:
- the name of the given Object
-
getNames
public java.util.Vector<java.lang.String> getNames()
Deprecated.Return a Vector of names- Returns:
- a Vector of names
-
getObjects
public java.util.Vector<java.lang.Object> getObjects()
Deprecated.Return a Vector of Objects- Returns:
- a Vector of Objects
-
indexOf
public int indexOf(java.lang.String name)
Deprecated.Returns the index of the Object which has been mapped (associated) with the given name- Parameters:
name
- the name- Returns:
- the index of the Object which has been mapped (associated) to the given name
-
put
public void put(java.lang.String name, java.lang.Object obj)
Deprecated.Maps (associates) an Object with a name- Parameters:
name
- the name to associate with the given Objectobj
- the Object to be mapped
-
remove
public java.lang.Object remove(int index) throws java.lang.IndexOutOfBoundsException
Deprecated.Removes and returns the Object located at the given index- Parameters:
index
- the index of the Object to remove- Returns:
- the object removed from the map.
- Throws:
java.lang.IndexOutOfBoundsException
-
remove
public java.lang.Object remove(java.lang.String name)
Deprecated.Removes and returns the Object associated with the given name- Parameters:
name
- the name of the Object to remove- Returns:
- the object removed from the map.
-
size
public int size()
Deprecated.Returns the number of Object associations currently in this named map- Returns:
- the number of Object associations currently in this named map
-
-