|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
edu.rice.cs.drjava.model.definitions.indent.IndentRuleQuestion
public abstract class IndentRuleQuestion
A question node in the decision tree for the indentation system. Calls to indentLine on an
IndentRuleQuestion will make a decision based on context and call the same method on one of its children.
The leaves of the tree are represented by IndentRuleAction objects.
| Field Summary | |
|---|---|
private IndentRule |
_noRule
Node in decision tree to use if the rule does not hold in this context. |
private IndentRule |
_yesRule
Node in decision tree to use if the rule holds in this context. |
| Fields inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace |
|---|
NO, TERMINUS_RULE, YES |
| Constructor Summary | |
|---|---|
IndentRuleQuestion(IndentRule yesRule,
IndentRule noRule)
Constructs a new Question indent rule using the two given children. |
|
| Method Summary | |
|---|---|
(package private) abstract boolean |
applyRule(AbstractDJDocument doc,
Indenter.IndentReason reason)
Determines if the given rule holds in this context. |
(package private) boolean |
applyRule(AbstractDJDocument doc,
int pos,
Indenter.IndentReason reason)
Determines if the given rule holds in this context. |
boolean |
indentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
Determines if the given rule holds in this context and calls the same method on one of its child nodes. |
(package private) boolean |
testApplyRule(AbstractDJDocument doc,
Indenter.IndentReason reason)
Convenience method that wraps calls on applyRule in a read lock. |
(package private) boolean |
testApplyRule(AbstractDJDocument doc,
int pos,
Indenter.IndentReason reason)
Convenience method that wraps calls on applyRule in a read lock. |
boolean |
testIndentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
Convenience method that wraps calls on indentLine in a write lock. |
| Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace |
|---|
_addToIndentTrace, getRuleName, getTrace, indentLine, printLastIndentTrace, setRuleTraceEnabled, testIndentLine |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final IndentRule _yesRule
private final IndentRule _noRule
| Constructor Detail |
|---|
public IndentRuleQuestion(IndentRule yesRule,
IndentRule noRule)
yesRule - Rule to use if this rule holdsnoRule - Rule to use if this rule does not hold| Method Detail |
|---|
abstract boolean applyRule(AbstractDJDocument doc,
Indenter.IndentReason reason)
doc - AbstractDJDocument containing the line to be indented.reason - The reason that indentation was initiated, specified in Indenter
boolean applyRule(AbstractDJDocument doc,
int pos,
Indenter.IndentReason reason)
doc - The AbstractDJDocument containing the line to be indented.pos - The Position within line to be indented.reason - The reason that indentation was initiated, specified in Indenter
public boolean indentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
indentLine in interface IndentRuleindentLine in class IndentRuleWithTracedoc - AbstractDJDocument containing the line to be indented.reason - The reason that indentation was initiated, specified in Indenter
boolean testApplyRule(AbstractDJDocument doc,
Indenter.IndentReason reason)
boolean testApplyRule(AbstractDJDocument doc,
int pos,
Indenter.IndentReason reason)
public boolean testIndentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
testIndentLine in class IndentRuleWithTrace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||