edu.princeton.swing.text
Class HighlightedDocument.Position

java.lang.Object
  extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.swing.text.Position
Position.Bias
 
Field Summary
protected  int id
           
protected  int offset
           
 
Constructor Summary
protected HighlightedDocument.Position(int id, int offset)
          Instantiates a new Position.
 
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
 

Field Detail

id

protected int id

offset

protected int offset
Constructor Detail

HighlightedDocument.Position

protected HighlightedDocument.Position(int id,
                                       int offset)
Instantiates a new Position.

Method Detail

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.