java.lang.ObjectLetterPair
public class LetterPair
LetterPair is a special kind of string that contains just two alphabetic characters.
| Constructor Summary | |
|---|---|
LetterPair()
Construct an empty LetterPair. |
|
LetterPair(char first,
char second)
Construct a LetterPair from two characters. |
|
LetterPair(java.lang.String letters)
Construct a LetterPair from a string. |
|
| Method Summary | |
|---|---|
int |
compareTo(LetterPair val)
Compares this LetterPair with the provided LetterPair. |
boolean |
equals(java.lang.Object other)
Compare two LetterPairs for equality. |
java.lang.String |
toString()
Return a string representation of this LetterPair |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LetterPair()
public LetterPair(char first,
char second)
first - the first character of the pairsecond - the second character of the pairpublic LetterPair(java.lang.String letters)
letters - a String to be assigned to this LetterPair| Method Detail |
|---|
public int compareTo(LetterPair val)
val - LetterPair to which this LetterPair 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