edu.msu.cme.rdp.classifier.train
Class GoodWordIterator

java.lang.Object
  extended by edu.msu.cme.rdp.classifier.train.GoodWordIterator

public class GoodWordIterator
extends java.lang.Object

A GoodWordIterator creates a list of valid words from the input string.


Field Summary
private static int[] charIntegerLookup
           
private  int curIndex
           
(package private) static int MASK
           
(package private) static int MAX_ASCII
           
private  int numOfWords
           
private  int[] wordIndexArr
           
(package private) static int WORDSIZE
           
 
Constructor Summary
GoodWordIterator(java.lang.String seq)
          Creates a new instance of GoodWordIterator
 
Method Summary
private  void createWordIndex(java.lang.String seq)
          Fetches every overlapping word, change the string to integer and saves in an array.
(package private)  int getMask()
          Returns the mask.
(package private)  int getNumofWords()
          Returns the number of unique words.
(package private)  int getWordsize()
          Returns the size of word.
 boolean hasNext()
          Returns true if the iteration has more good element on deck.
 int next()
          Returns the next good element in the iteration.
(package private)  void resetCurIndex()
          Reset the current index to 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curIndex

private int curIndex

numOfWords

private int numOfWords

wordIndexArr

private int[] wordIndexArr

WORDSIZE

static final int WORDSIZE
See Also:
Constant Field Values

MASK

static final int MASK
See Also:
Constant Field Values

MAX_ASCII

static final int MAX_ASCII
See Also:
Constant Field Values

charIntegerLookup

private static int[] charIntegerLookup
Constructor Detail

GoodWordIterator

public GoodWordIterator(java.lang.String seq)
                 throws java.io.IOException
Creates a new instance of GoodWordIterator

Throws:
java.io.IOException
Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more good element on deck.


next

public int next()
         throws java.util.NoSuchElementException
Returns the next good element in the iteration.

Throws:
java.util.NoSuchElementException

createWordIndex

private void createWordIndex(java.lang.String seq)
                      throws java.io.IOException
Fetches every overlapping word, change the string to integer and saves in an array.

Throws:
java.io.IOException

getWordsize

int getWordsize()
Returns the size of word.


getMask

int getMask()
Returns the mask.


getNumofWords

int getNumofWords()
Returns the number of unique words.


resetCurIndex

void resetCurIndex()
Reset the current index to 0.