net.sf.jsefa.common.lowlevel.filter
Class HeaderAndFooterFilter

java.lang.Object
  extended by net.sf.jsefa.common.lowlevel.filter.HeaderAndFooterFilter
All Implemented Interfaces:
LineFilter

public final class HeaderAndFooterFilter
extends Object
implements LineFilter

A filter for filtering out header and footer lines.

Instances of this class are immutable and thread-safe.

Author:
Norman Lahme-Huetig

Constructor Summary
HeaderAndFooterFilter(int headerSize, boolean hasFooter, boolean storeFailedLines)
          Constructs a new HeaderAndFooterFilter.
 
Method Summary
 FilterResult filter(String line, int lineNumber, boolean truncated, boolean lastLine)
          Filters the given line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderAndFooterFilter

public HeaderAndFooterFilter(int headerSize,
                             boolean hasFooter,
                             boolean storeFailedLines)
Constructs a new HeaderAndFooterFilter.

Parameters:
headerSize - the size of the header to skip, i. e. number of lines
hasFooter - true, if there is a footer to skip; false otherwise
storeFailedLines - true, if the lines which fail the filter should be stored; false otherwise
Method Detail

filter

public FilterResult filter(String line,
                           int lineNumber,
                           boolean truncated,
                           boolean lastLine)
Filters the given line.

Specified by:
filter in interface LineFilter
Parameters:
line - the content of the line
lineNumber - the number of the line
truncated - true, if the given content is incomplete, i. e. truncated at the end; false otherwise.
lastLine - true, if it is the last line; false otherwise
Returns:
a Result


Copyright © 2014. All rights reserved.