at.dms.compiler.tools.jperf
Class JPerf

java.lang.Object
  extended by at.dms.compiler.tools.jperf.JPerf

public class JPerf
extends Object

This class represents the perfect hashing function generator


Constructor Summary
JPerf(String[] keywords, String[] header, String[] footer)
          Constructs a JPerf object with default load factor of 5
JPerf(String[] keywords, String[] header, String[] footer, double loadFactor)
          Constructs a JPerf object
 
Method Summary
 void build()
          Builds tables and graph.
 void genCode(String fileName)
          Dumps result to class source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPerf

public JPerf(String[] keywords,
             String[] header,
             String[] footer,
             double loadFactor)
Constructs a JPerf object

Parameters:
keywords - the keywords to hash
header - the verbatim part to output at the beginning of the file
footer - the verbatim part to output at the end of the file
loadFactor - factor the load factor

JPerf

public JPerf(String[] keywords,
             String[] header,
             String[] footer)
Constructs a JPerf object with default load factor of 5

Parameters:
keywords - the keywords to hash
header - the verbatim part to output at the beginning of the file
footer - the verbatim part to output at the end of the file
Method Detail

build

public void build()
Builds tables and graph. Tasks: 1. generate the tables table1 and table2; 2. generate the graph 3. assure that the graph is acyclic


genCode

public void genCode(String fileName)
             throws IOException
Dumps result to class source.

Parameters:
fileName - the name of the output file.
Throws:
IOException