org.prorefactor.refactor
Class Scan

java.lang.Object
  extended by org.prorefactor.refactor.Scan

public class Scan
extends java.lang.Object

Scan objects are managed by a ScanManager. By having scan objects, scans can come and go, attributes can be set, etc. These are for working with scans that are related to an AST, and not intended for use with "standalone scans".


Field Summary
 int fileIndex
           
 int scanNum
           
 
Constructor Summary
Scan(int fileIndex)
           
 
Method Summary
 int getTopNode()
          Assuming that the top node will never change (it shouldn't) then it's safe to hang on to a handle to that top node.
 void indent(int begin, int end)
          Indent the code, using the current project's "indent" settings.
 void syncAllQStrings()
          One reason for synchronizing QSTRING nodes into a scanner is for the indenting functions: We sync all QSTRING nodes so that we don't add spaces (or tab) into the middle of a quoted string; (the spaces/tabs are only added to NEWLINE tokens).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileIndex

public int fileIndex

scanNum

public int scanNum
Constructor Detail

Scan

public Scan(int fileIndex)
     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getTopNode

public int getTopNode()
Assuming that the top node will never change (it shouldn't) then it's safe to hang on to a handle to that top node. It's something we need to refer to quite often, this is just a convenience function.


indent

public void indent(int begin,
                   int end)
Indent the code, using the current project's "indent" settings. Synchronizes as many QSTRING nodes from the AST as possible first, so that multi-line quoted strings don't get text added to them.

Parameters:
begin - first line to be indented.
end - last line to be indented. Use 0 to indent to end.

syncAllQStrings

public void syncAllQStrings()
One reason for synchronizing QSTRING nodes into a scanner is for the indenting functions: We sync all QSTRING nodes so that we don't add spaces (or tab) into the middle of a quoted string; (the spaces/tabs are only added to NEWLINE tokens).

Parameters:
queryName - The query for all QSTRING nodes must have been created by the client.
numResults - The number of results from the query.


Copyright © 2008 Joanju Software. All Rights Reserved.