pobs.scanner
Class PLineScanner

java.lang.Object
  extended bypobs.scanner.PLineScanner
All Implemented Interfaces:
PScanner

public class PLineScanner
extends java.lang.Object
implements PScanner

Remembers the position last scanned in line/column format. XXX: This class is currently not threadsafe

Author:
Martijn W. van der Lee

Field Summary
static byte CR
           
static byte CRLF
           
static byte LF
           
 
Constructor Summary
PLineScanner(PScanner scanner)
          Sole constructor, takes another scanner.
 
Method Summary
 char charAt(long index)
          Returns the character at the specified location.
 long getColumn()
          Insert the method's description here.
 byte getEndOfLine()
          Insert the method's description here.
 long getLine()
          Insert the method's description here.
 int getTabSize()
          Insert the method's description here.
 boolean isAbsoluteTab()
          Insert the method's description here.
 long length()
          Gives the length of this iterators' content.
 void parseUptoIndex(long newIndex)
          Parses the scanner upto the specified index
 void reset()
          Insert the method's description here.
 void setAbsoluteTab(boolean newAbsoluteTab)
          Insert the method's description here.
 void setEndOfLine(byte newEndOfLine)
          Insert the method's description here.
 void setTabSize(int newTabSize)
          Insert the method's description here.
 java.lang.String substring(long beginIndex, long endIndex)
          Returns the part of the input from the beginning upto the ending index locations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRLF

public static final byte CRLF
See Also:
Constant Field Values

CR

public static final byte CR
See Also:
Constant Field Values

LF

public static final byte LF
See Also:
Constant Field Values
Constructor Detail

PLineScanner

public PLineScanner(PScanner scanner)
Sole constructor, takes another scanner.

Method Detail

charAt

public char charAt(long index)
            throws java.lang.IndexOutOfBoundsException
Description copied from interface: PScanner
Returns the character at the specified location.

Specified by:
charAt in interface PScanner
Parameters:
index - position of the character to return
Returns:
character at the specified index
Throws:
java.lang.IndexOutOfBoundsException - when the specified index is either less than zero or equal or more than the length

getColumn

public long getColumn()
Insert the method's description here.

Returns:
long

getEndOfLine

public byte getEndOfLine()
Insert the method's description here.

Returns:
byte

getLine

public long getLine()
Insert the method's description here.

Returns:
long

getTabSize

public int getTabSize()
Insert the method's description here.

Returns:
int

isAbsoluteTab

public boolean isAbsoluteTab()
Insert the method's description here.

Returns:
boolean

length

public long length()
Description copied from interface: PScanner
Gives the length of this iterators' content. That is; the last position which can be indexed.

Specified by:
length in interface PScanner
Returns:
the length of this iterator.

parseUptoIndex

public void parseUptoIndex(long newIndex)
Parses the scanner upto the specified index


reset

public void reset()
Insert the method's description here.


setAbsoluteTab

public void setAbsoluteTab(boolean newAbsoluteTab)
Insert the method's description here.

Parameters:
newAbsoluteTab - boolean

setEndOfLine

public void setEndOfLine(byte newEndOfLine)
Insert the method's description here.

Parameters:
newEndOfLine - byte

setTabSize

public void setTabSize(int newTabSize)
Insert the method's description here.

Parameters:
newTabSize - int

substring

public java.lang.String substring(long beginIndex,
                                  long endIndex)
Description copied from interface: PScanner
Returns the part of the input from the beginning upto the ending index locations.

Specified by:
substring in interface PScanner
Parameters:
beginIndex - starting offset from which to extract the substring
endIndex - ending offset at which the substring ends
Returns:
the substring
See Also:
String