Class Word
- java.lang.Object
-
- org.apache.wicket.examples.hangman.Word
-
- All Implemented Interfaces:
Serializable,IClusterable
public class Word extends Object implements IClusterable
Model for a word in the game of Game.- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Constructor Detail
-
Word
public Word(String word)
Constructor- Parameters:
word- The word
-
-
Method Detail
-
asString
public String asString()
- Returns:
- This word
-
asString
public String asString(boolean hideUnguessed)
- Parameters:
hideUnguessed- True if unguessed letters should be hidden- Returns:
- This word as a String
-
equals
public boolean equals(Object object)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
guess
public boolean guess(Letter letter)
- Parameters:
letter- The letter to guess- Returns:
- True if guess was correct
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
isGuessed
public boolean isGuessed()
- Returns:
- True if the word has been guessed
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
-