com.swabunga.spell.event
Class JavaWordFinder

java.lang.Object
  extended bycom.swabunga.spell.event.AbstractWordFinder
      extended bycom.swabunga.spell.event.JavaWordFinder
All Implemented Interfaces:
WordFinder

public class JavaWordFinder
extends AbstractWordFinder

A basic word finder, which searches text for sequences of letters.

Author:
Anthony Roy ([email protected])

Field Summary
 
Fields inherited from class com.swabunga.spell.event.AbstractWordFinder
currentWord, nextWord, sentenceIterator, startsSentence, text
 
Constructor Summary
JavaWordFinder()
           
JavaWordFinder(java.lang.String inText)
          Creates a new DefaultWordFinder object.
 
Method Summary
protected  void init()
          Initializes this word finder
 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, isWordChar, isWordChar, replace, setSentenceIterator, setText, startsSentence, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaWordFinder

public JavaWordFinder(java.lang.String inText)
Creates a new DefaultWordFinder object.

Parameters:
inText - the String to search

JavaWordFinder

public JavaWordFinder()
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 interface WordFinder
Specified by:
next in class AbstractWordFinder
Returns:
the next word.
Throws:
WordNotFoundException - search string contains no more words.

init

protected void init()
Initializes this word finder

Overrides:
init in class AbstractWordFinder