public class TMFFTwoColumnAlignment extends TMFFMethod
TMFFTwoColumnAlignment renders a parsed sub-expression and if the expression exceeds the input length or tree depth parameters, the sub-expression is broken up across multiple lines.
Example: maxDepth = 1 render "( a -> b )" as follows: "( a -> b )" where "a" and "b" are metavariables that may be replaced by sub-expressions of arbitrary length and depth. Note that the trailing constant is appended to the current line (or if no more room exists then it is indented 4 columns from the right column's position. Example: maxDepth = 1 render "a (_ b" as follows: " a (_ b" where "a" and "b" are metavariables that may be replaced by sub-expressions of arbitrary length and depth.
maxDepth
Constructor and Description |
---|
TMFFTwoColumnAlignment()
Default constructor.
|
TMFFTwoColumnAlignment(int maxDepth)
Standard constructor for TMFFTwoColumnAlignment.
|
TMFFTwoColumnAlignment(java.lang.String maxDepthString)
Constructor for TMFFTwoColumnAlignment from user parameters.
|
Modifier and Type | Method and Description |
---|---|
org.json.JSONArray |
asArray()
Output the array form of this method's parameters.
|
protected int |
renderSubExprWithBreaks(TMFFStateParams tmffSP,
ParseNode currNode,
int leftmostColNbr) |
boolean |
updateMaxDepth(int maxDepth)
Updates maxDepth for a TMFFMethod if the Method allows updates.
|
constructMethodWithUserParams, renderFormula, renderSubExpr, validateMaxDepth, validateMaxDepth
public TMFFTwoColumnAlignment()
public TMFFTwoColumnAlignment(int maxDepth)
maxDepth
- maximum sub-tree depth for a sub-expression that will not
trigger a line-break, not counting leaf nodes, and
non-Notation Syntax Axioms such as Type Conversions.public TMFFTwoColumnAlignment(java.lang.String maxDepthString)
maxDepthString
- maximum sub-tree depth for a sub-expression that
will not trigger a line-break, not counting leaf nodes, and
non-Notation Syntax Axioms such as Type Conversions.public org.json.JSONArray asArray()
TMFFMethod
asArray
in class TMFFMethod
public boolean updateMaxDepth(int maxDepth)
updateMaxDepth
in class TMFFMethod
maxDepth
- parameter.protected int renderSubExprWithBreaks(TMFFStateParams tmffSP, ParseNode currNode, int leftmostColNbr)
renderSubExprWithBreaks
in class TMFFMethod