/**
* Sets the number of lines to be returned in the filtered stream.
*
* @param lines the number of lines to be returned in the filtered stream
*/
public void setLines( final long lines) {
this.lines = lines;
}
/**
* Returns the number of lines to be returned in the filtered stream.
*
* @return the number of lines to be returned in the filtered stream
*/
private long getLines() {
return lines;
}
/**
* Sets the number of lines to be skipped in the filtered stream.
*
* @param skip the number of lines to be skipped in the filtered stream
*/
public void setSkip( final long skip) {
this.skip = skip;
}
/**
* Returns the number of lines to be skipped in the filtered stream.
*
* @return the number of lines to be skipped in the filtered stream
*/
private long getSkip() {
return skip;
}
/**
* Creates a new TailFilter using the passed in
* Reader for instantiation.
*
* @param rdr A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
/**
* Creates a new HeadFilter using the passed in
* Reader for instantiation.
*
* @param rdr A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
public Reader chain( final Reader rdr) {
[[#variablefdaab00]] newFilter = new [[#variablefdaab00]](rdr);
newFilter.setLines(getLines());
newFilter.setSkip(getSkip());
newFilter.setInitialized(true);
return newFilter;
}
|