java.lang.ObjectDigraph
public class Digraph
Digraph represents a pair of letters and their frequency of occurrence. Digraphs are ordered alphabetically.
| Constructor Summary | |
|---|---|
Digraph()
A Digraph is constructed with an empty letter pair, a count of zero and a default format pattern. |
|
Digraph(LetterPair pair,
Natural frequency)
A Digraph is constructed from the provided LetterPair, the provided frequency count, and a default format pattern. |
|
Digraph(java.lang.String pair)
A Digraph is constructed from the provided String, a count of zero and a default format pattern. |
|
| Method Summary | |
|---|---|
int |
compareTo(Digraph other)
Compares this Digraph with the provided Digraph. |
boolean |
equals(java.lang.Object other)
Compare two digraphs for equality. |
Natural |
getCount()
Get the count from this digraph. |
void |
increment()
Increment the count by 1. |
void |
setPattern(java.lang.String pattern)
Set a new format pattern for this digraph's numeric display. |
java.lang.String |
toString()
Return a formatted string representation of this letter pair. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Digraph()
public Digraph(java.lang.String pair)
public Digraph(LetterPair pair,
Natural frequency)
| Method Detail |
|---|
public void setPattern(java.lang.String pattern)
java.lang.IllegalArgumentException - if the given pattern is
not a valid java.text.DecimalFormat pattern.public Natural getCount()
public void increment()
public int compareTo(Digraph other)
compareTo in interface java.lang.Comparable<Digraph>other - Digraph to which this Digraph is to be compared.
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object