xbn.array
Class AOSLHashtable

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.AOSLHashtable
All Implemented Interfaces:
Cloneable

public class AOSLHashtable
extends XBNObject
implements Cloneable

Holds metadata for an array of (possibly unique) string values in a Hashtable, for use in an AOSLookup. See java.util.Hashtable and AOSLookup.

Source code:  AOSLHashtable.java

This object wraps around a Hashtable, which is expected to have keys that are the strings from the array, and values which are UniqueStrings, containing metadata about the key string.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
AOSLHashtable(Hashtable h_ashtable)
          Create an AOSLHashtable.
AOSLHashtable(Hashtable h_ashtable, boolean b_verifyHashtable)
          Create an AOSLHashtable.
 
Method Summary
protected  Object clone()
          Get a full (deep) copy of this AOSLHashtable as an Object.
 boolean containsKey(String s_tr)
          Is the provided string an existing key in the Hashtable?
 Enumeration elements()
          Get an Enumeration containing every element in the Hashtable.
 AOSLHashtable getAOSLHClone()
          Get a full (deep) copy of this AOSLHashtable.
 Hashtable getHTClone()
          Get a full (deep) clone of the internally held Hashtable.
 PASString getPASString()
          Get a PASString containing a (newly created) string array of the names in this AOSLookup.
 UniqueString getUniqueString(String s_key)
          Get the UniqueString object having a certain key.
 Enumeration keys()
          Get an Enumeration containing every key in the Hashtable.
 int size()
          How many elements exist in the Hashtable?
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AOSLHashtable

public AOSLHashtable(Hashtable h_ashtable)

Create an AOSLHashtable.

Equal to AOSLHashtable(h_ashtable, false)


AOSLHashtable

public AOSLHashtable(Hashtable h_ashtable,
                     boolean b_verifyHashtable)

Create an AOSLHashtable.

Parameters:
h_ashtable - The hashtable to wrap around. May not be null.
b_verifyHashtable - If true, then h_ashtable is verified to ensure that the keys are a set of unique strings, the values are of type UniqueString, the key and UniqueString.getString are equal, and all the UniqueString.getUnqArrIdx are unique, zero or greater, and that every value between zero and [whatever the maximum value is] exists. If any of these requirements are not met, then an AssertException is thrown. If this parameter is false, then it is assumed that h_ashtable's keys and values are valid. Use false with care.
Method Detail

containsKey

public boolean containsKey(String s_tr)

Is the provided string an existing key in the Hashtable?

Parameters:
s_tr - The string to analyze.
Returns:
[h_ashtable].containsKey(s_tr) Where h_ashtable is exactly as provided to the constructor.

getUniqueString

public UniqueString getUniqueString(String s_key)

Get the UniqueString object having a certain key.

Parameters:
s_key - The string value of the key, which points to the desired UniqueString object.
Returns:
((UniqueString)h_ashtable.get(s_key)) Where h_ashtable is exactly as provided to the constructor.

size

public int size()

How many elements exist in the Hashtable?

Returns:
h_ashtable.size Where h_ashtable is exactly as provided to the constructor.

keys

public Enumeration keys()

Get an Enumeration containing every key in the Hashtable.

Returns:
h_ashtable.keys Where h_ashtable is exactly as provided to the constructor.

elements

public Enumeration elements()

Get an Enumeration containing every element in the Hashtable.

Returns:
h_ashtable.elements Where h_ashtable is exactly as provided to the constructor.

getPASString

public final PASString getPASString()

Get a PASString containing a (newly created) string array of the names in this AOSLookup.

Note the order of the string array is exactly the same as was provided to the constructor.


getHTClone

public final Hashtable getHTClone()

Get a full (deep) clone of the internally held Hashtable.

Returns:
(new Utility().getOptimizedHT(h_ashtable)) Where h_ashtable is exactly as provided to the constructor.

getAOSLHClone

public final AOSLHashtable getAOSLHClone()

Get a full (deep) copy of this AOSLHashtable.

Returns:
(AOSLHashtable)clone()

clone

protected Object clone()
                throws CloneNotSupportedException

Get a full (deep) copy of this AOSLHashtable as an Object.

Overrides:
clone in class Object



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo