jasp.util
Class Dictionary

java.lang.Object
  |
  +--jasp.util.Dictionary

public class Dictionary
extends java.lang.Object

Dictionary object stores data key, item pairs. A Dictionary object is the equivalent of a PERL associative array. Items, which can be any form of data, are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and usually a integer or a string, but can be anything except an array.


Constructor Summary
Dictionary()
          Constructs a Dictionary object.
 
Method Summary
 void Add(java.lang.String key, boolean value)
          Adds a key and item pair to a Dictionary object.
 void Add(java.lang.String key, double value)
          Adds a key and item pair to a Dictionary object.
 void Add(java.lang.String key, int value)
          Adds a key and item pair to a Dictionary object.
 void Add(java.lang.String key, java.lang.Object value)
          Adds a key and item pair to a Dictionary object.
 void Add(java.lang.String key, java.lang.String value)
          Adds a key and item pair to a Dictionary object.
 java.util.Enumeration elements()
          Returns an enumerator for the keys of the Dictionary.
 boolean Exists(java.lang.String key)
          Returns true if a specified key exists in the Dictionary object, false if it does not.
 int getCompareMode()
          Returns the comparison mode for comparing string keys in a Dictionary object.
 int getCount()
          Returns the number of items in a collection or Dictionary object.
 variant getItem(java.lang.String key)
          Returns an item for a specified key in a Dictionary object.
 java.lang.String getKey(int index)
          Gets a key from a Dictionary object.
 java.lang.String getKey(java.lang.String key)
          Gets a key of item from the Dictionary object.
 vbarray Items()
          Returns an array containing all the items in a Dictionary object.
 vbarray Keys()
          Returns an array containing all existing keys in a Dictionary object.
 void Remove(int index)
          Removes a key, item pair from a Dictionary object.
 void Remove(java.lang.String key)
          Removes a key, item pair from a Dictionary object.
 void RemoveAll()
          The RemoveAll method removes all key, item pairs from a Dictionary object.
 void setCompareMode(int cm)
          Sets and returns the comparison mode for comparing string keys in a Dictionary object.
 void setItem(java.lang.String key, boolean item)
          Sets an item for a specified key in a Dictionary object.
 void setItem(java.lang.String key, double value)
          Sets an item for a specified key in a Dictionary object.
 void setItem(java.lang.String key, java.lang.Object value)
          Sets an item for a specified key in a Dictionary object.
 void setItem(java.lang.String key, java.lang.String value)
          Sets an item for a specified key in a Dictionary object.
 void setKey(java.lang.String key, java.lang.String newkey)
          Sets a key of the item in a Dictionary object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dictionary

public Dictionary()
Constructs a Dictionary object.
Method Detail

getCompareMode

public int getCompareMode()
Returns the comparison mode for comparing string keys in a Dictionary object.

setCompareMode

public void setCompareMode(int cm)
                    throws java.lang.Exception
Sets and returns the comparison mode for comparing string keys in a Dictionary object.

getKey

public java.lang.String getKey(java.lang.String key)
Gets a key of item from the Dictionary object.

elements

public java.util.Enumeration elements()
Returns an enumerator for the keys of the Dictionary.

getKey

public java.lang.String getKey(int index)
Gets a key from a Dictionary object.
Parameters:
index - the index of the key.

setItem

public void setItem(java.lang.String key,
                    java.lang.Object value)
Sets an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
Parameters:
key - the key of the item.
value - the value of the item.

setItem

public void setItem(java.lang.String key,
                    java.lang.String value)
Sets an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
Parameters:
key - the key of the item.
value - the value of the item.

setItem

public void setItem(java.lang.String key,
                    double value)
Sets an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
Parameters:
key - the key of the item.
value - the value of the item.

setItem

public void setItem(java.lang.String key,
                    boolean item)
Sets an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
Parameters:
key - the key of the item.
value - the value of the item.

getItem

public variant getItem(java.lang.String key)
Returns an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
Parameters:
key - the key of the item.
Returns:
the value of the item.

Add

public void Add(java.lang.String key,
                java.lang.Object value)
         throws java.lang.Exception
Adds a key and item pair to a Dictionary object.
Parameters:
key - the key of the item.
value - the value of the item.

Add

public void Add(java.lang.String key,
                int value)
         throws java.lang.Exception
Adds a key and item pair to a Dictionary object.
Parameters:
key - the key of the item.
value - the value of the item.

Add

public void Add(java.lang.String key,
                double value)
         throws java.lang.Exception
Adds a key and item pair to a Dictionary object.
Parameters:
key - the key of the item.
value - the value of the item.

Add

public void Add(java.lang.String key,
                boolean value)
         throws java.lang.Exception
Adds a key and item pair to a Dictionary object.
Parameters:
key - the key of the item.
value - the value of the item.

Add

public void Add(java.lang.String key,
                java.lang.String value)
         throws java.lang.Exception
Adds a key and item pair to a Dictionary object.
Parameters:
key - the key of the item.
value - the value of the item.

setKey

public void setKey(java.lang.String key,
                   java.lang.String newkey)
Sets a key of the item in a Dictionary object.
Parameters:
key - the key of the item.
newkey - the new key of the item.

Keys

public vbarray Keys()
             throws java.lang.Exception
Returns an array containing all existing keys in a Dictionary object.

Items

public vbarray Items()
              throws java.lang.Exception
Returns an array containing all the items in a Dictionary object.

Remove

public void Remove(int index)
Removes a key, item pair from a Dictionary object.
Parameters:
index - the index of the key.

Remove

public void Remove(java.lang.String key)
Removes a key, item pair from a Dictionary object.

RemoveAll

public void RemoveAll()
The RemoveAll method removes all key, item pairs from a Dictionary object.

getCount

public int getCount()
Returns the number of items in a collection or Dictionary object.

Exists

public boolean Exists(java.lang.String key)
Returns true if a specified key exists in the Dictionary object, false if it does not.