org.htmlparser.lexer
Class Cursor
- Cloneable, Serializable, Ordered
public class Cursor
implements Serializable, Ordered, Cloneable
A bookmark in a page.
This class remembers the page it came from and its position within the page.
Cursor(Page page, int offset) - Construct a
Cursor from the page and position given.
|
void | advance() - Move the cursor position ahead one character.
|
int | compare(Object that) - Compare one reference to another.
|
Cursor | dup() - Make a new cursor just like this one.
|
Page | getPage() - Get this cursor's page.
|
int | getPosition() - Get the position of this cursor.
|
void | retreat() - Move the cursor position back one character.
|
void | setPosition(int position) - Set the position of this cursor.
|
String | toString() - Return a string representation of this cursor
|
mPage
protected Page mPage
This cursor's page.
mPosition
protected int mPosition
This cursor's position.
Cursor
public Cursor(Page page,
int offset)
Construct a Cursor
from the page and position given.
page
- The page this cursor is on.offset
- The character offset within the page.
advance
public void advance()
Move the cursor position ahead one character.
compare
public int compare(Object that)
Compare one reference to another.
- compare in interface Ordered
that
- The object to compare this to.
- A negative integer, zero, or a positive
integer as this object is less than, equal to,
or greater than that object.
dup
public Cursor dup()
Make a new cursor just like this one.
- The new cursor positioned where
this
one is,
and referring to the same page.
getPage
public Page getPage()
Get this cursor's page.
- The page associated with this cursor.
getPosition
public int getPosition()
Get the position of this cursor.
retreat
public void retreat()
Move the cursor position back one character.
setPosition
public void setPosition(int position)
Set the position of this cursor.
position
- The new cursor position.
toString
public String toString()
Return a string representation of this cursor
- A string of the form "n[r,c]", where n is the character position,
r is the row (zero based) and c is the column (zero based) on the page.
| © 2005 Derrick Oswald Mai 08, 2008 |
HTML Parser is an open source library released under LGPL. |  |