|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.swabunga.spell.event.AbstractWordFinder
public abstract class AbstractWordFinder
Defines common methods and behaviour for the various word finding subclasses.
Constructor Summary | |
---|---|
AbstractWordFinder()
|
|
AbstractWordFinder(java.lang.String inText)
Creates a new AbstractWordFinder object. |
Method Summary | |
---|---|
Word |
current()
Returns the current word in the iteration . |
java.lang.String |
getText()
Return the text being searched. |
boolean |
hasNext()
Tests the finder to see if any more words are available. |
abstract Word |
next()
This method scans the text from the end of the last word, and returns a new Word object corresponding to the next word. |
void |
replace(java.lang.String newWord)
Replace the current word in the search with a replacement string. |
void |
setText(java.lang.String newText)
This method resets the text through which the WordFinder iterates. |
boolean |
startsSentence()
|
java.lang.String |
toString()
Return the text being searched. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractWordFinder(java.lang.String inText)
inText
- the String to iterate through.public AbstractWordFinder()
Method Detail |
---|
public abstract Word next()
next
in interface WordFinder
public java.lang.String getText()
getText
in interface WordFinder
public void setText(java.lang.String newText)
WordFinder
setText
in interface WordFinder
newText
- the new text to search.public Word current()
current
in interface WordFinder
WordNotFoundException
- current word has not yet been set.public boolean hasNext()
WordFinder
hasNext
in interface WordFinder
public void replace(java.lang.String newWord)
replace
in interface WordFinder
newWord
- the replacement string.
WordNotFoundException
- current word has not yet been set.public boolean startsSentence()
startsSentence
in interface WordFinder
WordNotFoundException
- current word has not yet been set.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |