|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hcrypto.analyzer.FrequencyTable
Field Summary | |
static int |
MAX_CHARS
|
Fields inherited from interface hcrypto.analyzer.Analyzer |
DECIPHER_LIMIT |
Constructor Summary | |
FrequencyTable(java.lang.String text)
|
|
FrequencyTable(java.lang.String text,
int alpha)
|
Method Summary | |
protected java.lang.String |
charToString(char ch)
Converts a nonprintable character to a string |
void |
count()
Counts the characters in the text. |
int |
getAlphabeticsCount()
Returns a count of just alphabetic characters |
int |
getCharCount()
Returns a count of all characters. |
int |
getCount(int ch)
Returns the count for a specific character |
FrequencyRecord[] |
getCryptogramFrequencies()
|
int[] |
getFrequencies()
returns the frequencies as an array |
int |
getHighestFreq()
returns the highest frequency character |
int[] |
getHistogramData()
Constructs an array of int out of the frequency tables |
java.lang.String |
getKHighestFreqChar(int k)
returns the the kth highest frequency character |
java.lang.String |
getReport()
|
FrequencyRecord[] |
getSortedCryptogramFrequencies()
|
void |
print()
|
void |
run()
Everything is done in setup. |
void |
setAlphabetRange(int range)
Sets alphabetRange to an ASCII subset. |
void |
setup(java.lang.String text)
From the Analyzer interface. |
protected void |
sort()
Uses the java.util.Arrays sort method to sort the frquencies and stores the results in sortedFrequencies. |
java.lang.String |
toString()
Arranges the frequencies as a 2-D table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_CHARS
Constructor Detail |
public FrequencyTable(java.lang.String text)
public FrequencyTable(java.lang.String text, int alpha)
Method Detail |
public void setup(java.lang.String text)
setup
in interface Analyzer
public void run()
run
in interface Analyzer
public java.lang.String getReport()
getReport
in interface Analyzer
public void setAlphabetRange(int range)
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public void count()
public int getHighestFreq()
public java.lang.String getKHighestFreqChar(int k)
public FrequencyRecord[] getCryptogramFrequencies()
public FrequencyRecord[] getSortedCryptogramFrequencies()
public int[] getFrequencies()
public int[] getHistogramData()
protected java.lang.String charToString(char ch)
public int getCharCount()
public int getAlphabeticsCount()
public int getCount(int ch)
protected void sort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |