com.swabunga.spell.event
Class Word
java.lang.Object
|
+--com.swabunga.spell.event.Word
- public class Word
- extends java.lang.Object
Constructor Summary |
Word(java.lang.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 |
void |
copy(Word w)
Sets the value of this Word to be a copy of another. |
int |
getEnd()
|
int |
getStart()
|
java.lang.String |
getText()
|
int |
length()
|
void |
setStart(int s)
Set the start index of the word. |
void |
setText(java.lang.String s)
Set the text to a new string value. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Word
public Word(java.lang.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.
getEnd
public int getEnd()
- Returns:
- the end index of the word.
setStart
public void setStart(int s)
- Set the start index of the word.
- Parameters:
s
- the start index.
getStart
public int getStart()
- Returns:
- the start index.
setText
public void setText(java.lang.String s)
- Set the text to a new string value.
- Parameters:
s
- the new text
getText
public java.lang.String getText()
- Returns:
- the String representing the word.
copy
public void copy(Word w)
- Sets the value of this Word to be a copy of another.
- Parameters:
w
- the Word to copy.
length
public int length()
- Returns:
- the length of the word.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- the text representing the word.