Jacson

de.spieleck.app.jacson.select
Class WordSelect

java.lang.Object
  extended byde.spieleck.app.jacson.select.WordSelect
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonRegistrable, JacsonSelect

public class WordSelect
extends java.lang.Object
implements JacsonSelect, ConfigVerify.Acceptor

Selects every word out of a chunk and returns them as chunks. To separate the words delimiters are used in a "StringTokenizer-way". (@see java.util.StringTokenizer). The delimiters themselves are not returned as words.

Author:
Patrick Carl, fsn

Field Summary
protected  java.lang.String currentChunk
           
static java.lang.String DEFAULT_DELIM
           
protected  java.lang.String delims
           
static java.lang.String DELIMS_NODE
           
protected  int lastMatch
           
protected  int length
           
protected  SimpleResult result
           
 
Constructor Summary
WordSelect()
          Creates a new instance of WordSelect
 
Method Summary
 boolean accept(ConfigNode node)
           
 SelectionResult getNextSelection()
          A word is delimited by one or multiple of the given delimiter characters or by the beginning and the end of the chunk
 void init(ConfigNode node, JacsonRegistry registry)
           
 void setChunk(java.lang.String chunk)
           
 void setDelims(java.lang.String delimsString)
          inits the delimiters to be used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMS_NODE

public static final java.lang.String DELIMS_NODE
See Also:
Constant Field Values

DEFAULT_DELIM

public static final java.lang.String DEFAULT_DELIM
See Also:
Constant Field Values

delims

protected java.lang.String delims

currentChunk

protected java.lang.String currentChunk

lastMatch

protected int lastMatch

length

protected int length

result

protected SimpleResult result
Constructor Detail

WordSelect

public WordSelect()
Creates a new instance of WordSelect

Method Detail

getNextSelection

public SelectionResult getNextSelection()
A word is delimited by one or multiple of the given delimiter characters or by the beginning and the end of the chunk

Specified by:
getNextSelection in interface JacsonSelect
Returns:
the next word of the chunk in a SelectionResult.

init

public void init(ConfigNode node,
                 JacsonRegistry registry)
          throws JacsonConfigException
Specified by:
init in interface JacsonRegistrable
Throws:
JacsonConfigException

setDelims

public void setDelims(java.lang.String delimsString)
inits the delimiters to be used


setChunk

public void setChunk(java.lang.String chunk)
Specified by:
setChunk in interface JacsonSelect

accept

public boolean accept(ConfigNode node)
Specified by:
accept in interface ConfigVerify.Acceptor

Spieleck

Copyleft 2002 spieleck.de.