com.unitesk.atp.text.filters
Class PositionFilter
java.lang.Object
com.unitesk.atp.text.filters.Filter
com.unitesk.atp.text.filters.PositionFilter
- All Implemented Interfaces:
- TextReceiver
public class PositionFilter
- extends Filter
Calculates line and position in output text.
Line is counted from 1.
Column is counted from 0.
- Since:
- 3.3-beta-050628
- Version:
- $Id: PositionFilter.java,v 1.3 2005/07/06 10:24:06 all-x Exp $
- Author:
- Alexey Demakov
Fields inherited from class com.unitesk.atp.text.filters.Filter |
client |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_TAB_SIZE
public static final int DEFAULT_TAB_SIZE
- See Also:
- Constant Field Values
DEFAULT_FIXED_TAB_SIZE
public static final boolean DEFAULT_FIXED_TAB_SIZE
- See Also:
- Constant Field Values
tabSize
protected int tabSize
fixedTabSize
protected boolean fixedTabSize
PositionFilter
public PositionFilter(TextReceiver client,
int tabSize,
boolean fixedTabSize)
- Filter constructor.
- Parameters:
client
- Filter client.tabSize
- Tab size.fixedTabSize
- If true
, tab char always increases
column by tabSize
.
Otherwise column is increased to the next value
divisible by tabSize
.
PositionFilter
public PositionFilter(TextReceiver client)
getLine
public int getLine()
setLine
public void setLine(int l)
getColumn
public int getColumn()
setColumn
public void setColumn(int c)
getPosition
public Position getPosition()
setPosition
public void setPosition(Position position)
lineLength
public static int lineLength(String s)
updateColumn
public static int updateColumn(int currentColumn,
String s)
txt
public void txt(String s)
- Description copied from class:
Filter
- The default implementation passes input string
to the client without any changes.
- Specified by:
txt
in interface TextReceiver
- Overrides:
txt
in class Filter
- Parameters:
s
- The string to process.
nl
public void nl()
- Description copied from class:
Filter
- The default implementation passes line separator
to the client without any changes.
- Specified by:
nl
in interface TextReceiver
- Overrides:
nl
in class Filter
Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.