proyecto
Class JavaTextPane.DocPosition

java.lang.Object
  extended by proyecto.JavaTextPane.DocPosition
Enclosing class:
JavaTextPane

 class JavaTextPane.DocPosition
extends Object

A wrapper for a position in a document appropriate for storing in a collection.


Constructor Summary
JavaTextPane.DocPosition(int position)
          Construct a DocPosition from the given offset into the document.
 
Method Summary
 JavaTextPane.DocPosition adjustPosition(int adjustment)
          Adjust this position.
 boolean equals(Object obj)
          Two DocPositions are equal iff they have the same internal position.
(package private)  int getPosition()
          Get the position represented by this DocPosition
 String toString()
          A string representation useful for debugging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaTextPane.DocPosition

public JavaTextPane.DocPosition(int position)
Construct a DocPosition from the given offset into the document.

Parameters:
position - The position this DocObject will represent
Method Detail

getPosition

int getPosition()
Get the position represented by this DocPosition

Returns:
the position

adjustPosition

public JavaTextPane.DocPosition adjustPosition(int adjustment)
Adjust this position. This is useful in cases that an amount of text is inserted or removed before this position.

Parameters:
adjustment - amount (either positive or negative) to adjust this position.
Returns:
the DocPosition, adjusted properly.

equals

public boolean equals(Object obj)
Two DocPositions are equal iff they have the same internal position.

Overrides:
equals in class Object
Returns:
if this DocPosition represents the same position as another.

toString

public String toString()
A string representation useful for debugging.

Overrides:
toString in class Object
Returns:
A string representing the position.