org.exolab.javasource
Class JNamedMap
java.lang.Object
org.exolab.javasource.JNamedMap
public final class JNamedMap
extends java.lang.Object
A simple String to Object mapping which preserves order.
Note: This class is not synchronized. So be careful. :-)
$Revision: 6669 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $JNamedMap() - Creates a new JNamedMap.
|
JNamedMap(int size) - Creates a new JNamedMap with the given size.
|
Object | get(String name) - Returns the Object associated with the given name.
|
Object | get(int index) - Returns the Object at the given index.
|
String | getNameByObject(Object obj) - Returns the name associated with the given Object.
|
Vector | getNames() - Returns a Vector of names.
|
Vector | getObjects() - Returns 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(String name) - Removes and returns the Object associated with the given name.
|
Object | remove(int index) - Removes and returns the Object located at the given index.
|
int | size() - Returns the number of Object associations currently in this named map.
|
JNamedMap
public JNamedMap()
Creates a new JNamedMap.
JNamedMap
public JNamedMap(int size)
Creates a new JNamedMap with the given size.
size
- The initial size for this NamedMap.
get
public Object get(String name)
Returns the Object associated with the given name.
name
- The name to search for.
- The Object associated with the given name.
get
public Object get(int index)
Returns the Object at the given index.
index
- The index of the Object to return.
- The Object at the given index.
getNameByObject
public String getNameByObject(Object obj)
Returns the name associated with the given Object.
obj
- The Object to search for.
- The name of the given Object.
getNames
public Vector getNames()
Returns a Vector of names.
getObjects
public Vector getObjects()
Returns a Vector of Objects.
indexOf
public int indexOf(String name)
Returns the index of the Object which has been mapped (associated) with
the given name.
name
- The name to get the index of.
- The index of the Object which has been mapped (associated) to the
given name.
put
public void 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.
remove
public Object remove(String name)
Removes and returns the Object associated with the given name.
name
- The name of the Object to remove.
- The object removed from the map.
remove
public Object remove(int index)
Removes and returns the Object located at the given index.
index
- The index of the Object to remove.
- The object removed from the map.
size
public int size()
Returns the number of Object associations currently in this named map.
- The number of Object associations currently in this named map.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com