Class JNamedMap
java.lang.Object
org.codehaus.modello.plugin.java.javasource.JNamedMap
Deprecated.
A simple String to Object mapping which preserves order.
Note: This class is not synchronized. So be careful. :-)-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Deprecated.Returns the Object at the given index.Deprecated.Returns the Object associated with the given name.getNameByObject
(Object obj) Deprecated.Returns the name associated with the given ObjectgetNames()
Deprecated.Return a Vector of namesDeprecated.Return a Vector of Objectsint
Deprecated.Returns the index of the Object which has been mapped (associated) with the given namevoid
Deprecated.Maps (associates) an Object with a nameremove
(int index) Deprecated.Removes and returns the Object located at the given indexDeprecated.Removes and returns the Object associated with the given nameint
size()
Deprecated.Returns the number of Object associations currently in this named map
-
Field Details
-
names
Deprecated. -
objects
Deprecated.
-
-
Constructor Details
-
JNamedMap
public JNamedMap()Deprecated.Creates a new JNamedMap -
JNamedMap
public JNamedMap(int size) Deprecated.Creates a new JNamedMap with the given size.- Parameters:
size
- the initial size for this NamedMap
-
-
Method Details
-
get
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
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:
IndexOutOfBoundsException
-
getNameByObject
Deprecated.Returns the name associated with the given Object- Parameters:
obj
- the Object to search for- Returns:
- the name of the given Object
-
getNames
Deprecated.Return a Vector of names- Returns:
- a Vector of names
-
getObjects
Deprecated.Return a Vector of Objects- Returns:
- a Vector of Objects
-
indexOf
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
Deprecated.Maps (associates) an Object with a name- Parameters:
name
- the name to associate with the given Objectobj
- the Object to be mapped
-
remove
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:
IndexOutOfBoundsException
-
remove
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
-
LinkedHashMap
instead