edu.princeton.swing.text
Class HighlightedDocument.Position
java.lang.Object
edu.princeton.swing.text.HighlightedDocument.Position
- All Implemented Interfaces:
- Position
- Enclosing class:
- HighlightedDocument
public class HighlightedDocument.Position
- extends Object
- implements Position
Position is a simple implementation of javax.swing.text.Position.
Field Summary |
protected int |
id
|
protected int |
offset
|
Method Summary |
int |
getOffset()
Returns the offset encapsulated by this Position. |
void |
setOffset(int offset)
Sets the offset encapsulated by this Position. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
id
protected int id
offset
protected int offset
HighlightedDocument.Position
protected HighlightedDocument.Position(int id,
int offset)
- Instantiates a new Position.
setOffset
public void setOffset(int offset)
- Sets the offset encapsulated by this Position. If the offset is out of bounds, the
the offset will be silently corrected.
- Parameters:
offset
- The new offset this Position should return.
getOffset
public int getOffset()
- Returns the offset encapsulated by this Position.
- Specified by:
getOffset
in interface Position
- Returns:
- The offset represented by this Position.