Package com.swabunga.spell.event
Class DefaultWordFinder
- java.lang.Object
-
- com.swabunga.spell.event.AbstractWordFinder
-
- com.swabunga.spell.event.DefaultWordFinder
-
- All Implemented Interfaces:
WordFinder
public class DefaultWordFinder extends AbstractWordFinder
A basic word finder, which searches text for sequences of letters.- Author:
- Anthony Roy (ajr@antroy.co.uk)
-
-
Field Summary
-
Fields inherited from class com.swabunga.spell.event.AbstractWordFinder
currentWord, nextWord, sentenceIterator, startsSentence, text
-
-
Constructor Summary
Constructors Constructor Description DefaultWordFinder()
Creates a new DefaultWordFinder object.DefaultWordFinder(java.lang.String inText)
Creates a new DefaultWordFinder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.-
Methods inherited from class com.swabunga.spell.event.AbstractWordFinder
current, getText, hasNext, ignore, ignore, ignore, ignore, init, isWordChar, isWordChar, replace, setSentenceIterator, setText, startsSentence, toString
-
-
-
-
Method Detail
-
next
public 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.- Specified by:
next
in interfaceWordFinder
- Specified by:
next
in classAbstractWordFinder
- Returns:
- the next word.
- Throws:
WordNotFoundException
- search string contains no more words.
-
-