com.unitesk.atp.text.filters
Class Filter

java.lang.Object
  extended by com.unitesk.atp.text.filters.Filter
All Implemented Interfaces:
TextReceiver
Direct Known Subclasses:
IndentFilter, LineSplitFilter, PatternFilter, PositionFilter

public class Filter
extends Object
implements TextReceiver

Text filter receives portion of text, processes it and emit results to client. Text filter can be client of other filter so filters can be combined in chain to perform complicated text processing.

Version:
$Id: Filter.java,v 1.1 2004/10/09 06:36:40 all-x Exp $
Author:
Alexey Demakov

Field Summary
protected  TextReceiver client
           
 
Constructor Summary
Filter(TextReceiver client)
          Constructs text filter with the specified client.
 
Method Summary
 TextReceiver getClient()
          Gets the client of this filter.
 void nl()
          The default implementation passes line separator to the client without any changes.
 void txt(String s)
          The default implementation passes input string to the client without any changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected TextReceiver client
Constructor Detail

Filter

public Filter(TextReceiver client)
Constructs text filter with the specified client.

Parameters:
client - The client of this filter.
Throws:
NullPointerException - If client is null.
Method Detail

getClient

public TextReceiver getClient()
Gets the client of this filter.

Returns:
The client of this filter.

txt

public void txt(String s)
The default implementation passes input string to the client without any changes.

Specified by:
txt in interface TextReceiver
Parameters:
s - The string to process.

nl

public void nl()
The default implementation passes line separator to the client without any changes.

Specified by:
nl in interface TextReceiver


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.