com.ds.fw.types
Class FwHashVector

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--com.ds.fw.types.FwHashVector
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class FwHashVector
extends java.util.Hashtable

See Also:
Serialized Form

Field Summary
 java.util.Vector vec
           
 
Constructor Summary
FwHashVector()
          Constructs a new, empty FwHashVector with a default capacity and load factor, which is 0.75.
FwHashVector(int initialCapacity)
          Constructs a new, empty FwHashVector with the specified initial capacity and default load factor, which is 0.75.
FwHashVector(int initialCapacity, float loadFactor)
          Constructs a new, empty FwHashVector with the specified initial capacity and the specified load factor.
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this FwHashVector.
 void add(int index, java.lang.Object element, java.lang.Object key)
          Inserts the specified element at the specified position in this FwHashVector.
 boolean add(java.lang.Object element)
          Appends the specified element to the end of this FwHashVector.
 boolean addAll(java.util.Collection c)
          Appends all of the elements in the specified Collection to the end of this FwHashVector, in the order that they are returned by the specified Collection's Iterator.
 boolean addAll(int index, java.util.Collection c)
          Inserts all of the elements in in the specified Collection into this FwHashVector at the specified position.
 void addElement(java.lang.Object element)
          Adds the specified component to the end of this FwHashVector, increasing its size by one.
 int capacity()
          Returns the current capacity of this FwHashVector.
 void clear()
          Clears this FwHashVector so that it contains no keys.
 java.lang.Object clone()
          Creates a shallow copy of this FwHashVector.
 boolean contains(java.lang.Object value)
          Tests if some key maps into the specified value in this FwHashVector.
 boolean containsAll(java.util.Collection c)
          Returns true if this FwHashVector contains all of the elements in the specified Collection.
 boolean containsKey(java.lang.Object key)
          Tests if the specified object is a key in this FwHashVector.
 boolean containsValue(java.lang.Object value)
          Returns true if this FwHashVector maps one or more keys to this value.
 void copyInto(java.lang.Object[] anArray)
          Copies the components of this FwHashVector into the specified array.
 java.lang.Object elementAt(int index)
          Returns the component at the specified index.
 java.util.Enumeration elements()
          Returns an enumeration of the values in this FwHashVector.
 void ensureCapacity(int minCapacity)
          Increases the capacity of this FwHashVector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.
 java.util.Set entrySet()
          Returns a Set view of the entries contained in this FwHashVector.
 boolean equals(java.lang.Object o)
          Compares the specified Object with this Map for equality, as per the definition in the Map interface.
 java.lang.Object firstElement()
          Returns the first component (the item at index 0) of this FwHashVector.
 java.lang.Object get(int index)
          Returns the element at the specified position in this FwHashVector.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this FwHashVector.
 float getFloat(java.lang.Object key)
          Returns the value to which the specified key is mapped in this FwHashVector.
 long getLong(java.lang.Object key)
          Returns the value to which the specified key is mapped in this FwHashVector.
 java.util.Vector getVec()
           
 int hashCode()
          Returns the hash code value for this Map as per the definition in the Map interface.
 int indexFromKey(java.lang.Object key)
          Returns the index of the last key in this FwHashVector.
 int indexOf(java.lang.Object elem)
          Searches for the first occurence of the given argument, testing for equality using the equals method.
 int indexOf(java.lang.Object elem, int index)
          Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
 void insertElementAt(java.lang.Object obj, int index)
          Inserts the specified object as a component in this FwHashVector at the specified index.
 boolean isEmpty()
          Tests if this FwHashVector maps no keys to values.
 java.lang.Object keyFromIndex(int index)
          Returns the index of the last key in this FwHashVector.
 java.util.Enumeration keys()
          Returns an enumeration of the keys in this FwHashVector.
 java.util.Set keySet()
          Returns a Set view of the keys contained in this FwHashVector.
 java.lang.Object lastElement()
          Returns the last component of the FwHashVector.
 int lastIndexOf(java.lang.Object elem)
          Returns the index of the last occurrence of the specified object in this FwHashVector.
 int lastIndexOf(java.lang.Object elem, int index)
          Searches backwards for the specified object, starting from the specified index, and returns an index to it.
 java.lang.Object lastKeyOf(java.lang.Object value)
          Returns the index of the last occurrence of the specified object in this FwHashVector.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Maps the specified key to the specified value in this FwHashVector.
 void putAll(java.util.Map t)
          Copies all of the mappings from the specified Map to this FwHashVector These mappings will replace any mappings that this FwHashVector had for any of the keys currently in the specified Map.
protected  void rehash()
          Increases the capacity of and internally reorganizes this FwHashVector, in order to accommodate and access its entries more efficiently.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this FwHashVector.
 java.lang.Object remove(java.lang.Object key)
          Removes the key (and its corresponding value) from this FwHashVector.
 void removeAllElements()
          Removes all components from this FwHashVector and sets its size to zero.
 boolean removeElement(java.lang.Object value)
          Removes the first (lowest-indexed) occurrence of the argument from this FwHashVector.
 void removeElementAt(int index)
          Deletes the component at the specified index.
 java.lang.Object set(int index, java.lang.Object element)
          Replaces the element at the specified position in this FwHashVector with the specified element.
 java.lang.Object set(int index, java.lang.Object element, java.lang.Object key1)
          Replaces the element at the specified position in this FwHashVector with the specified element.
 void setElementAt(java.lang.Object element, int index)
          Sets the component at the specified index of this FwHashVector to be the specified object.
 int size()
          Returns the number of keys in this FwHashVector.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this FwHashVector in the correct order.
 java.lang.Object[] toArray(java.lang.Object[] a)
          Returns an array containing all of the elements in this FwHashVector in the correct order.
 java.lang.String toString()
          Returns a string representation of this FwHashVector object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space).
 void trimToSize()
          Trims the capacity of this FwHashVector to be the FwHashVector's current size.
 
Methods inherited from class java.util.Hashtable
values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

vec

public java.util.Vector vec
Constructor Detail

FwHashVector

public FwHashVector()
Constructs a new, empty FwHashVector with a default capacity and load factor, which is 0.75.


FwHashVector

public FwHashVector(int initialCapacity)
Constructs a new, empty FwHashVector with the specified initial capacity and default load factor, which is 0.75.


FwHashVector

public FwHashVector(int initialCapacity,
                    float loadFactor)
Constructs a new, empty FwHashVector with the specified initial capacity and the specified load factor.

Method Detail

getVec

public java.util.Vector getVec()

clear

public void clear()
Clears this FwHashVector so that it contains no keys.

Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.Hashtable

clone

public java.lang.Object clone()
Creates a shallow copy of this FwHashVector.

Overrides:
clone in class java.util.Hashtable

contains

public boolean contains(java.lang.Object value)
Tests if some key maps into the specified value in this FwHashVector.

Overrides:
contains in class java.util.Hashtable

containsKey

public boolean containsKey(java.lang.Object key)
Tests if the specified object is a key in this FwHashVector.

Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class java.util.Hashtable

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if this FwHashVector maps one or more keys to this value.

Specified by:
containsValue in interface java.util.Map
Overrides:
containsValue in class java.util.Hashtable

elements

public java.util.Enumeration elements()
Returns an enumeration of the values in this FwHashVector.

Overrides:
elements in class java.util.Hashtable

entrySet

public java.util.Set entrySet()
Returns a Set view of the entries contained in this FwHashVector.

Specified by:
entrySet in interface java.util.Map
Overrides:
entrySet in class java.util.Hashtable

equals

public boolean equals(java.lang.Object o)
Compares the specified Object with this Map for equality, as per the definition in the Map interface.

Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.util.Hashtable

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped in this FwHashVector.

Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.Hashtable

getLong

public long getLong(java.lang.Object key)
Returns the value to which the specified key is mapped in this FwHashVector.


getFloat

public float getFloat(java.lang.Object key)
Returns the value to which the specified key is mapped in this FwHashVector.


hashCode

public int hashCode()
Returns the hash code value for this Map as per the definition in the Map interface.

Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.util.Hashtable

isEmpty

public boolean isEmpty()
Tests if this FwHashVector maps no keys to values.

Specified by:
isEmpty in interface java.util.Map
Overrides:
isEmpty in class java.util.Hashtable

keys

public java.util.Enumeration keys()
Returns an enumeration of the keys in this FwHashVector.

Overrides:
keys in class java.util.Hashtable

keySet

public java.util.Set keySet()
Returns a Set view of the keys contained in this FwHashVector.

Specified by:
keySet in interface java.util.Map
Overrides:
keySet in class java.util.Hashtable

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Maps the specified key to the specified value in this FwHashVector.

Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.Hashtable

putAll

public void putAll(java.util.Map t)
Copies all of the mappings from the specified Map to this FwHashVector These mappings will replace any mappings that this FwHashVector had for any of the keys currently in the specified Map.

Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class java.util.Hashtable

rehash

protected void rehash()
Increases the capacity of and internally reorganizes this FwHashVector, in order to accommodate and access its entries more efficiently.

Overrides:
rehash in class java.util.Hashtable

remove

public java.lang.Object remove(java.lang.Object key)
Removes the key (and its corresponding value) from this FwHashVector.

Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.Hashtable

size

public int size()
Returns the number of keys in this FwHashVector.

Specified by:
size in interface java.util.Map
Overrides:
size in class java.util.Hashtable

toString

public java.lang.String toString()
Returns a string representation of this FwHashVector object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). Collection values() Returns a Collection view of the values contained in this FwHashVector.

Overrides:
toString in class java.util.Hashtable

indexFromKey

public int indexFromKey(java.lang.Object key)
Returns the index of the last key in this FwHashVector.


keyFromIndex

public java.lang.Object keyFromIndex(int index)
Returns the index of the last key in this FwHashVector.


lastKeyOf

public java.lang.Object lastKeyOf(java.lang.Object value)
Returns the index of the last occurrence of the specified object in this FwHashVector.


add

public void add(int index,
                java.lang.Object element,
                java.lang.Object key)
Inserts the specified element at the specified position in this FwHashVector.


add

public void add(int index,
                java.lang.Object element)
Inserts the specified element at the specified position in this FwHashVector.


add

public boolean add(java.lang.Object element)
Appends the specified element to the end of this FwHashVector.


addAll

public boolean addAll(java.util.Collection c)
Appends all of the elements in the specified Collection to the end of this FwHashVector, in the order that they are returned by the specified Collection's Iterator.


addAll

public boolean addAll(int index,
                      java.util.Collection c)
Inserts all of the elements in in the specified Collection into this FwHashVector at the specified position.


addElement

public void addElement(java.lang.Object element)
Adds the specified component to the end of this FwHashVector, increasing its size by one.


capacity

public int capacity()
Returns the current capacity of this FwHashVector.


containsAll

public boolean containsAll(java.util.Collection c)
Returns true if this FwHashVector contains all of the elements in the specified Collection.


copyInto

public void copyInto(java.lang.Object[] anArray)
Copies the components of this FwHashVector into the specified array.


elementAt

public java.lang.Object elementAt(int index)
Returns the component at the specified index.


ensureCapacity

public void ensureCapacity(int minCapacity)
Increases the capacity of this FwHashVector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.


firstElement

public java.lang.Object firstElement()
Returns the first component (the item at index 0) of this FwHashVector.


get

public java.lang.Object get(int index)
Returns the element at the specified position in this FwHashVector.


indexOf

public int indexOf(java.lang.Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method.


indexOf

public int indexOf(java.lang.Object elem,
                   int index)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.


insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index)
Inserts the specified object as a component in this FwHashVector at the specified index.


lastElement

public java.lang.Object lastElement()
Returns the last component of the FwHashVector.


lastIndexOf

public int lastIndexOf(java.lang.Object elem)
Returns the index of the last occurrence of the specified object in this FwHashVector.


lastIndexOf

public int lastIndexOf(java.lang.Object elem,
                       int index)
Searches backwards for the specified object, starting from the specified index, and returns an index to it.


remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this FwHashVector.


removeAllElements

public void removeAllElements()
Removes all components from this FwHashVector and sets its size to zero.


removeElement

public boolean removeElement(java.lang.Object value)
Removes the first (lowest-indexed) occurrence of the argument from this FwHashVector.


removeElementAt

public void removeElementAt(int index)
Deletes the component at the specified index.


set

public java.lang.Object set(int index,
                            java.lang.Object element,
                            java.lang.Object key1)
Replaces the element at the specified position in this FwHashVector with the specified element.


set

public java.lang.Object set(int index,
                            java.lang.Object element)
Replaces the element at the specified position in this FwHashVector with the specified element.


setElementAt

public void setElementAt(java.lang.Object element,
                         int index)
Sets the component at the specified index of this FwHashVector to be the specified object.


toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this FwHashVector in the correct order.


toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this FwHashVector in the correct order.


trimToSize

public void trimToSize()
Trims the capacity of this FwHashVector to be the FwHashVector's current size.