/** * Creates a new Word object. * * @param text the String representing the word. * @param start the start index of the word. */ public Word(String text, int start) { this.text = text; this.start = start; setEnd(); }
/** * Set the start index of the word. * * @param s the start index. */ public void setStart(int s) { start = s; setEnd(); }
/** * Set the text to a new string value. * * @param s the new text */ public void setText(String s) { text = s; setEnd(); }
/** * Sets the value of this Word to be a copy of another. * * @param w the Word to copy. */ public void copy(Word w) { text = w.toString(); start = w.getStart(); setEnd(); }