edu.rice.cs.drjava.model.definitions.indent
Class QuestionStartingNewStmt

java.lang.Object
  extended by edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
      extended by edu.rice.cs.drjava.model.definitions.indent.IndentRuleQuestion
          extended by edu.rice.cs.drjava.model.definitions.indent.QuestionStartingNewStmt
All Implemented Interfaces:
IndentRule

public class QuestionStartingNewStmt
extends IndentRuleQuestion

Determines if the current line is starting a new statement by searching backwards to see if the previous line was the end of a statement. Specifically, checks if the previous non-whitespace character not on this line is one of the following: ';', '{', '}', or 0.

Note that characters in comments and quotes are disregarded.

Version:
$Id: QuestionStartingNewStmt.java 4653 2008-08-26 14:46:35Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
NO, TERMINUS_RULE, YES
 
Constructor Summary
QuestionStartingNewStmt(IndentRule yesRule, IndentRule noRule)
          Constructs a new rule to determine if the current line is the start of a new statement.
 
Method Summary
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleQuestion
indentLine, testIndentLine
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
_addToIndentTrace, getRuleName, indentLine, printLastIndentTrace, setRuleTraceEnabled, testIndentLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestionStartingNewStmt

public QuestionStartingNewStmt(IndentRule yesRule,
                               IndentRule noRule)
Constructs a new rule to determine if the current line is the start of a new statement.

Parameters:
yesRule - Rule to use if this rule holds
noRule - Rule to use if this rule does not hold