hcrypto.analyzer
Class DigramAnalyzer
java.lang.Object
|
+--hcrypto.analyzer.DigramAnalyzer
- All Implemented Interfaces:
- Analyzer
- public class DigramAnalyzer
- extends java.lang.Object
- implements Analyzer
Method Summary |
java.lang.String |
decrypt()
|
void |
doAnalysis()
This method performs an analysis of the text. |
java.lang.String |
getReport()
This method is part of the Analyzer interface. |
void |
run()
This method is part of the Analyzer interface. |
void |
setup(java.lang.String text)
This method initializes the Analyzer. |
java.lang.String |
toString()
This method returns the report generated by the analysis. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DigramAnalyzer
public DigramAnalyzer()
DigramAnalyzer
public DigramAnalyzer(TextStatistics ts)
throws java.lang.NullPointerException
setup
public void setup(java.lang.String text)
- This method initializes the Analyzer.
- Specified by:
setup
in interface Analyzer
- Parameters:
text
- a String pointing to the text being analyzed
run
public void run()
- This method is part of the Analyzer interface. It runs the analysis.
- Specified by:
run
in interface Analyzer
getReport
public java.lang.String getReport()
- This method is part of the Analyzer interface. It returns the report
generated by the analysis.
- Specified by:
getReport
in interface Analyzer
toString
public java.lang.String toString()
- This method returns the report generated by the analysis.
- Overrides:
toString
in class java.lang.Object
decrypt
public java.lang.String decrypt()
doAnalysis
public void doAnalysis()
- This method performs an analysis of the text. It assumes the text
is a word-delimited cryptogram created using a simple substitution cipher.