Public Member Functions

org.exolab.javasource.JNamedMap Class Reference

List of all members.

Public Member Functions

 JNamedMap ()
 JNamedMap (int size)
Object get (String name)
Object get (int index) throws IndexOutOfBoundsException
String getNameByObject (Object obj)
Vector getNames ()
Vector getObjects ()
int indexOf (String name)
void put (String name, Object obj)
Object remove (int index) throws IndexOutOfBoundsException
Object remove (String name)
int size ()

Detailed Description

A simple String to Object mapping which preserves order.


Note: This class is not synchronized. So be careful. :-)

Author:
Keith Visco

Constructor & Destructor Documentation

org.exolab.javasource.JNamedMap.JNamedMap (  ) 

Creates a new JNamedMap

org.exolab.javasource.JNamedMap.JNamedMap ( int  size  ) 

Creates a new JNamedMap with the given size.

Parameters:
size the initial size for this NamedMap

Member Function Documentation

Object org.exolab.javasource.JNamedMap.get ( String  name  ) 
Object org.exolab.javasource.JNamedMap.get ( int  index  )  throws IndexOutOfBoundsException

Returns the Object at the given index.

Parameters:
index the index of the Object to return
Returns:
the Object at the given index
String org.exolab.javasource.JNamedMap.getNameByObject ( Object  obj  ) 

Returns the name associated with the given Object

Parameters:
obj the Object to search for
Returns:
the name of the given Object
Vector org.exolab.javasource.JNamedMap.getNames (  ) 

Return a Vector of names

Returns:
a Vector of names
Vector org.exolab.javasource.JNamedMap.getObjects (  ) 

Return a Vector of Objects

Returns:
a Vector of Objects
int org.exolab.javasource.JNamedMap.indexOf ( String  name  ) 

Returns the index of the Object which has been mapped (associated) with the given name

Returns:
the index of the Object which has been mapped (associated) to the given name

Referenced by org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JNamedMap.put(), and org.exolab.javasource.JNamedMap.remove().

void org.exolab.javasource.JNamedMap.put ( String  name,
Object  obj 
)
Object org.exolab.javasource.JNamedMap.remove ( int  index  )  throws IndexOutOfBoundsException

Removes and returns the Object located at the given index

Parameters:
name the name of the Object to remove
Returns:
the object removed from the map.

Referenced by org.exolab.javasource.JClass.removeField().

Object org.exolab.javasource.JNamedMap.remove ( String  name  ) 

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.

References org.exolab.javasource.JNamedMap.indexOf().

int org.exolab.javasource.JNamedMap.size (  ) 

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties