/** * Initializes this word finder */ protected void init() { // sentenceIterator = BreakIterator.getSentenceInstance(); // sentenceIterator.setText(text); super.init(); inComment = false; } }
/** * Creates a new AbstractWordFinder object. * * @param inText the String to iterate through. */ public AbstractWordFinder(String inText) { text = inText; setup(); }
/** * Ignores or skip over text starting from the index position specified * if it contains the <code>startIgnore</code>, and until the * first non letter or digit character is encountered or end of text is * detected. * @param index The start position in text. * @param startIgnore The character that should be at <code>index</code> * position to start skipping through. * @return The index position pointing after the skipped characters or the * original index if the ignore condition could not be met. */ protected int ignore(int index, char startIgnore) { return ignore(index, new Character(startIgnore), null); }
/** * Ignores or skip over text starting from the index position specified * if it contains the <code>startIgnore</code>, and until the * <code>endIgnore</code> character is encountered or end of text is * detected. * @param index The start position in text. * @param startIgnore The character that should be at <code>index</code> * position to start skipping through. * @param endIgnore The character which mark the end of skipping through. If * the value of endIgnore is <code>null</code>, skipping characters stop * at first non letter or digit character. * @return The index position pointing after the skipped characters or the * original index if the ignore condition could not be met. */ protected int ignore(int index, char startIgnore, char endIgnore) { return ignore(index, new Character(startIgnore), new Character(endIgnore)); }
/** * Creates a new default AbstractWordFinder object. */ public AbstractWordFinder() { text = ""; setup(); } //~ Methods ...............................................................
/** * Defines the text to search. * @param newText The text to be analyzed */ public void setText(String newText) { text = newText; setup(); }