|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.jperf.Table
This class is the internal representation of the tables T1 and T2. The meaning of T1 and T2 could be found in explanations of GGPerf's algorithm.
| Field Summary | |
private Hashtable[] |
heads
Variable holding all table heads for T1 and T2, respectively. |
private char |
maxCharValue
|
private int |
maxWordLength
|
private char |
minCharValue
|
private static Random |
random
The random number generator for generating values of T1 and T2. |
private String |
tableName
|
| Constructor Summary | |
Table(String tableName,
int maxWordLength,
char minCharValue,
char maxCharValue)
Creates an instance of table representing one of T1 and T2. |
|
| Method Summary | |
void |
genCode(PrintWriter out)
Outputs the contents of the table as a data structure, normally an array. |
long |
getKeyValue(String key)
Returns the value previously assigned to the key |
void |
init()
Initialises the internal structures |
long |
insertKey(String key,
long max)
Inserts the key into the table. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static Random random
private final String tableName
private final int maxWordLength
private final char minCharValue
private final char maxCharValue
private Hashtable[] heads
| Constructor Detail |
public Table(String tableName,
int maxWordLength,
char minCharValue,
char maxCharValue)
tableName - the name of the tablemaxWordLength - the maximum length of a keywordminCharValue - the smallest ASCII value in all keysmaxCharValue - the largest ASCII value in all keys?| Method Detail |
public void init()
public long insertKey(String key,
long max)
key - the key to insertmax - the maximum value
public long getKeyValue(String key)
key - the keypublic void genCode(PrintWriter out)
out - the output stream.
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||