aminePlatform.guis.prologPlusCGGUIs.prologPlusCGGUI
Class DocPosition

java.lang.Object
  extended byaminePlatform.guis.prologPlusCGGUIs.prologPlusCGGUI.DocPosition

class DocPosition
extends java.lang.Object

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


Constructor Summary
DocPosition(int position)
          Construct a DocPosition from the given offset into the document.
 
Method Summary
 DocPosition adjustPosition(int adjustment)
          Adjust this position.
 boolean equals(java.lang.Object obj)
          Two DocPositions are equal iff they have the same internal position.
(package private)  int getPosition()
          Get the position represented by this DocPosition
 java.lang.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

DocPosition

public 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 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(java.lang.Object obj)
Two DocPositions are equal iff they have the same internal position.

Returns:
if this DocPosition represents the same position as another.

toString

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

Returns:
A string representing the position.