Class: CountingLineProcessor
next
package
Processes only a certain number of lines.
Treat this class as "thread-hostile", since it is designed to be created,
used and discarded by a single thread.
Constructors |
Public ctor for initializing an instance of this class.
- Parameters:
anExpectedFirstCharset - maximum number of lines to be processed.
public CountingLineProcessor(int aMaximumLineCount)
|
Abstract base class for line processors associated with tuplizer or other class
that processes instances of
MaprptLine
, used mostly to support pragmas.
Treat this class as "thread-hostile", as it contains no synchronization and should
be created, used and discarded by a single thread.
public abstract class com.arsi.mj.maprpt.parser.lineproc.LineProcessorBase
extends java.lang.Object
Inner Interface IAction |
Nested interface that defines an action a line processor performs on a line.
public static interface com.arsi.mj.maprpt.parser.lineproc.LineProcessorBase.IAction
|
Process specified line.
- Parameters:
aMaprptLine - a typed line (e.g., AsteriskLine , PeriodLine , etc.) from a Mapper report.
- Returns:
- true to continue next stage of processing on line, false to stop processing of the line
after this method returns; applies to line, and not line processing (see
wantLine ).
public boolean processLine(com.arsi.mj.maprpt.parser.line.types.MaprptLine aMaprptLine)
|
Constructors |
public LineProcessorBase()
|
Methods |
Add processing action to this line processor.
- Parameters:
anAction - the processing action to add.
public void addAction(com.arsi.mj.maprpt.parser.lineproc.LineProcessorBase.IAction anAction)
|
Apply actions that have been registered with this line processor to the specified
Mapper report line. The calling convention is to invoke only after wantLine
indicates that the line processor is interested in the line.
- Parameters:
aMaprptLine - a typed line (e.g., AsteriskLine , PeriodLine , etc.) from a Mapper report.
- Returns:
- true to continue next stage of processing on line, false to stop processing of
the line after this method returns; if a line processor "eats" a line such that the
caller should not process the line, this method should return false.
public boolean applyActions(com.arsi.mj.maprpt.parser.line.types.MaprptLine aMaprptLine)
|
Remove processing action from this line processor.
- Parameters:
anAction - the processing action to remove.
public void removeAction(com.arsi.mj.maprpt.parser.lineproc.LineProcessorBase.IAction anAction)
|
Is line wanted by this line processor? If line is wanted, it should be passed
to applyActions for processing. If line is not wanted, no more calls
should be made to this line processor instance (treat as an end-of-file indicator).
IMPORTANT! Since derived classes may implement counting algorithms based on
calls to this method, the caller should invoke this method only once per line.
- Parameters:
aMaprptLine - a typed line (e.g., AsteriskLine , PeriodLine , etc.) from a Mapper report.
- Returns:
- true if line is wanted by line processor, false if line is not wanted.
public abstract boolean wantLine(com.arsi.mj.maprpt.parser.line.types.MaprptLine aMaprptLine)
|
Processes lines whose first characters match a prescribed set of characters.
Treat this class as "thread-hostile", since it is designed to be created,
used and discarded by a single thread.
Constructors |
Public ctor for initializing an instance of this class.
- Parameters:
anExpectedFirstCharset - set of characters to match against first character of lines to process.
public MatchingLineProcessor(java.lang.String anExpectedFirstCharset)
|