|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--edu.vt.marian.search.FullIDTable
|
+--edu.vt.marian.search.FullIDStringTable
Provides a hash table for FullIDs and Strings such that both can be used as keys to the other. So, a FullID can map to a String, and that String can reverse-map to the FullID. (I am presuming this mapping is one-to-one.)
This class implicitly relies upon the hashCode method to be defined in the object that is going to be used as a key object.
FullIDTable,
FullID,
FullID.hashCode(),
Hashtable,
Debug, Serialized Form| Fields inherited from class edu.vt.marian.search.FullIDTable |
BAD_PARAMS,
debug,
NULL_STREAM,
OK |
| Constructor Summary | |
FullIDStringTable(java.io.BufferedReader br,
edu.vt.marian.common.Debug debug)
Create a FullID/String hash table from a file of initial mappings. |
|
FullIDStringTable(edu.vt.marian.common.Debug debug)
Create an empty hash table for FullIDs and Strings |
|
FullIDStringTable(int initialCapacity,
edu.vt.marian.common.Debug debug)
Create an empty hash table for FullIDs and Strings specifying initial capacity, but with default load factor. |
|
FullIDStringTable(int initialCapacity,
float loadFactor,
edu.vt.marian.common.Debug debug)
Create an empty hash table for FullIDs and Strings specifying initial capacity and load factor. |
|
| Method Summary | |
boolean |
isInTable(java.lang.String string)
Test whether a given String is in the hash table. |
java.lang.Object |
put(edu.vt.marian.common.FullID fullID,
java.lang.String string)
Insert a FullID->String mapping into the hash table, along with the reverse mapping. |
int |
toStream(java.io.PrintWriter pw)
Dump the FullIDTable to an output stream (file). |
java.lang.String |
toString()
Convert hash table to a printable string representation. |
java.lang.String |
toString(int estimatedSize)
Convert hash table to a printable string representation. |
| Methods inherited from class java.util.Hashtable |
clear,
clone,
contains,
containsKey,
containsValue,
elements,
entrySet,
equals,
get,
hashCode,
isEmpty,
keys,
keySet,
put,
putAll,
rehash,
remove,
size,
values |
| Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public FullIDStringTable(edu.vt.marian.common.Debug debug)
public FullIDStringTable(int initialCapacity,
float loadFactor,
edu.vt.marian.common.Debug debug)
initialCapacity - initial size of hash tableloadFactor - occupancy threshold before growth neededdebug - debugging object
public FullIDStringTable(int initialCapacity,
edu.vt.marian.common.Debug debug)
initialCapacity - initial size of hash tabledebug - debugging object
public FullIDStringTable(java.io.BufferedReader br,
edu.vt.marian.common.Debug debug)
classID:instanceID\tString\n
As each mapping is read, it is inserted into the newly created hash table as both the forward and the reverse mapping.
| Method Detail |
public boolean isInTable(java.lang.String string)
string - String object to test for existence in hash table
public java.lang.Object put(edu.vt.marian.common.FullID fullID,
java.lang.String string)
fullID - FullID key valuestring - String mapped to by FullIDHashtable.put(java.lang.Object, java.lang.Object)public java.lang.String toString(int estimatedSize)
FullID.toString()public java.lang.String toString()
FullID.toString()public int toStream(java.io.PrintWriter pw)
pw - output stream to which hash table should be dumped
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||