public class Word
extends java.lang.Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(Word w)
Sets the value of this Word to be a copy of another.
|
int |
getEnd()
Evaluate the end of word position.
|
int |
getStart()
Evaluate the start of word position.
|
java.lang.String |
getText()
Supply the text string representing the word
|
int |
length()
Evaluate the length of the word.
|
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()
Supply the text representing the word.
|
public Word(java.lang.String text, int start)
text
- the String representing the word.start
- the start index of the word.public Word(Word w)
w
- the word object to clone.public int getEnd()
public void setStart(int s)
s
- the start index.public int getStart()
public void setText(java.lang.String s)
s
- the new textpublic java.lang.String getText()
public void copy(Word w)
w
- the Word to copy.public int length()
public java.lang.String toString()
toString
in class java.lang.Object