wyvern.kernel.commands.filters
Class HeadFilter

java.lang.Object
  extended bywyvern.kernel.commands.filters.HeadFilter
All Implemented Interfaces:
CommandFilter

public class HeadFilter
extends java.lang.Object
implements CommandFilter

Implements the "head" command: pass a numeric arg, such as "-20", to see that many lines of the output.

Version:
1.0, Jun 16, 2003
Author:
Steve Yegge

Constructor Summary
HeadFilter()
           
 
Method Summary
 java.util.ArrayList filter(java.util.ArrayList lines)
          Filters the lines.
 void parseArguments(java.lang.String verb, java.lang.String args)
          Parses the arguments to "head".
 java.lang.String toString()
          Returns String representation of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeadFilter

public HeadFilter()
Method Detail

parseArguments

public void parseArguments(java.lang.String verb,
                           java.lang.String args)
Parses the arguments to "head".

Specified by:
parseArguments in interface CommandFilter
Parameters:
verb - the command verb (e.g. "head").
args - the argument string passed to the command, not including the command verb. Null if no arguments were passed to the filter.

filter

public java.util.ArrayList filter(java.util.ArrayList lines)
Filters the lines.

Specified by:
filter in interface CommandFilter
Parameters:
lines - the event output, broken into lines.
Returns:
a subset of the lines, matched against the argument string.

toString

public java.lang.String toString()
Returns String representation of this filter.