Package org.htmlparser.lexer
Class Cursor
java.lang.Object
org.htmlparser.lexer.Cursor
- All Implemented Interfaces:
Serializable,Cloneable,Ordered
A bookmark in a page.
This class remembers the page it came from and its position within the page.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Move the cursor position ahead one character.intCompare one reference to another.dup()Make a new cursor just like this one.getPage()Get this cursor's page.intGet the position of this cursor.voidretreat()Move the cursor position back one character.voidsetPosition(int position) Set the position of this cursor.toString()Return a string representation of this cursor
-
Field Details
-
mPosition
protected int mPositionThis cursor's position. -
mPage
This cursor's page.
-
-
Constructor Details
-
Cursor
Construct aCursorfrom the page and position given.- Parameters:
page- The page this cursor is on.offset- The character offset within the page.
-
-
Method Details
-
getPage
Get this cursor's page.- Returns:
- The page associated with this cursor.
-
getPosition
public int getPosition()Get the position of this cursor.- Returns:
- The cursor position.
-
setPosition
public void setPosition(int position) Set the position of this cursor.- Parameters:
position- The new cursor position.
-
advance
public void advance()Move the cursor position ahead one character. -
retreat
public void retreat()Move the cursor position back one character. -
dup
Make a new cursor just like this one.- Returns:
- The new cursor positioned where
thisone is, and referring to the same page.
-
toString
Return a string representation of this cursor -
compare
Compare one reference to another.
-