站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

PositionRef (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.text
Class PositionRef

java.lang.Object
  extended byorg.openide.text.PositionRef
All Implemented Interfaces:
Serializable

public final class PositionRef
extends Object
implements Serializable

Reference to one position in a document. This position is held as an integer offset, or as a Position object. There is also support for serialization of positions.

See Also:
Serialized Form

Method Summary
 CloneableEditorSupport getCloneableEditorSupport()
           
 int getColumn()
          Get the column number where this position points to.
 int getLine()
          Get the line number where this position points to.
 int getOffset()
           
 Position getPosition()
           
 Position.Bias getPositionBias()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCloneableEditorSupport

public CloneableEditorSupport getCloneableEditorSupport()
Returns:
the appropriate manager for this position ref.

getPositionBias

public Position.Bias getPositionBias()
Returns:
the bias of the position

getPosition

public Position getPosition()
                     throws IOException
Returns:
the position as swing.text.Position object.
Throws:
IOException - when an exception occured during reading the file.

getOffset

public int getOffset()
Returns:
the position as offset index in the file.

getLine

public int getLine()
            throws IOException
Get the line number where this position points to.

Returns:
the line number for this position
Throws:
IOException - if the document could not be opened to check the line number

getColumn

public int getColumn()
              throws IOException
Get the column number where this position points to.

Returns:
the column number within a line (counting starts from zero)
Throws:
IOException - if the document could not be opened to check the column number

toString

public String toString()


Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.