private class PDAX2MDAG.GrepCallback extends java.lang.Object implements StreamGobblerCallback
Modifier and Type | Field and Description |
---|---|
private int |
mCount
The number of times the word appears.
|
private java.lang.String |
mWord
The word that is to be searched for.
|
private int |
mWordLength
The length of the word to be searched for.
|
Constructor and Description |
---|
GrepCallback(java.lang.String word)
Overloaded Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Returns the number of words counted so far.
|
void |
reset()
Resets the internal counters.
|
void |
work(java.lang.String line)
Callback whenever a line is read from the stream by the StreamGobbler.
|
private java.lang.String mWord
private int mWordLength
private int mCount
public GrepCallback(java.lang.String word)
word
- the word to be searched for.public void work(java.lang.String line)
work
in interface StreamGobblerCallback
line
- the line that is read.public int getCount()
public void reset()