org.prorefactor.core
Class CodeSelect

java.lang.Object
  extended by org.prorefactor.core.CodeSelect

public class CodeSelect
extends java.lang.Object

Provides methods for selecting surrounding code based on the AST, and shrinking and growing that selection.


Constructor Summary
CodeSelect(int file, int line, int col, PositionIndex index)
           
 
Method Summary
static int[] branchEndPos(JPNode node)
          Given the top node in a branch, find the file/line/column of the end of the last character of the last node in the branch.
 JPNode contract()
          Move cursor down tree towards initial position.
 JPNode expand()
          Move cursor up tree to parent Returns null if already at highest parent node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeSelect

public CodeSelect(int file,
                  int line,
                  int col,
                  PositionIndex index)
Method Detail

contract

public JPNode contract()
Move cursor down tree towards initial position. Returns null if already at the lowest node.


branchEndPos

public static int[] branchEndPos(JPNode node)
Given the top node in a branch, find the file/line/column of the end of the last character of the last node in the branch. This does not work for Program_root: the last child is a synthetic node, Program_tail.


expand

public JPNode expand()
Move cursor up tree to parent Returns null if already at highest parent node.



Copyright © 2008 Joanju Software. All Rights Reserved.