com.swabunga.spell.event

Class Word

public class Word extends Object

Offers basic methods to manipulate a text string representing a word.
Constructor Summary
Word(String text, int start)
Creates a new Word object.
Word(Word w)
Creates a new Word object by cloning an existing Word object.
Method Summary
voidcopy(Word w)
Sets the value of this Word to be a copy of another.
intgetEnd()
Evaluate the end of word position.
intgetStart()
Evaluate the start of word position.
StringgetText()
Supply the text string representing the word
intlength()
Evaluate the length of the word.
voidsetStart(int s)
Set the start index of the word.
voidsetText(String s)
Set the text to a new string value.
StringtoString()
Supply the text representing the word.

Constructor Detail

Word

public Word(String text, int start)
Creates a new Word object.

Parameters: text the String representing the word. start the start index of the word.

Word

public Word(Word w)
Creates a new Word object by cloning an existing Word object.

Parameters: w the word object to clone.

Method Detail

copy

public void copy(Word w)
Sets the value of this Word to be a copy of another.

Parameters: w the Word to copy.

getEnd

public int getEnd()
Evaluate the end of word position.

Returns: the end index of the word.

getStart

public int getStart()
Evaluate the start of word position.

Returns: the start index.

getText

public String getText()
Supply the text string representing the word

Returns: the String representing the word.

length

public int length()
Evaluate the length of the word.

Returns: the length of the word.

setStart

public void setStart(int s)
Set the start index of the word.

Parameters: s the start index.

setText

public void setText(String s)
Set the text to a new string value.

Parameters: s the new text

toString

public String toString()
Supply the text representing the word.

Returns: the text representing the word.