bill.apps.wordutil
Class Letter
java.lang.Object
|
+--bill.apps.wordutil.Letter
- Direct Known Subclasses:
- WordFindLetter, WordMakerLetter, WordSearchLetter
- public class Letter
- extends Object
This class is used to contain information about a letter that is available
to be a part of a word.
Constructor Summary |
Letter(char character,
int index)
The creator. |
Method Summary |
boolean |
equals(Object o)
Determines if two Letter objects are the equal. |
char |
getCharacter()
Indicates the character displayed on the letter. |
int |
getIndex()
Indicates the index of the letter in the letter list (0 based). |
boolean |
isUsed()
Indicates if the cube has been used in the current word. |
void |
setUsed(boolean used)
Sets the value of a letter to used or not used in the current word being
analyzed. |
String |
toString()
|
_lastLetter
protected int _lastLetter
Letter
public Letter(char character,
int index)
- The creator. Sets class variables to and specified values.
- Parameters:
character
- The character represented by this letterindex
- The index (0 based) of the letter in the list of letters
setUsed
public void setUsed(boolean used)
- Sets the value of a letter to used or not used in the current word being
analyzed.
- Parameters:
used
- true
indicates it has been used, false
it has not
isUsed
public boolean isUsed()
- Indicates if the cube has been used in the current word.
- Returns:
true
if the cubse has been used, false
otherwise
getIndex
public int getIndex()
- Indicates the index of the letter in the letter list (0 based).
- Returns:
- The letter's index.
getCharacter
public char getCharacter()
- Indicates the character displayed on the letter.
- Returns:
- The letter's character
equals
public boolean equals(Object o)
- Determines if two Letter objects are the equal. In our case equal means
the represent the same character.
- Overrides:
equals
in class Object
- Parameters:
0
- The Letter object to compare this one to.- Returns:
- Returns
true
if the Letter objects are equal,
otherwise returns false
.
toString
public String toString()
- Overrides:
toString
in class Object