|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.compiler.tools.jperf.Table
public class 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.
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 |
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |