Class Format.Prior
- All Implemented Interfaces:
Formattable,Serializable,Cloneable
- Enclosing class:
Format
parens format, if it is (directly or indirectly)
contained in a Prior Format with a higher priority level
(which is a numerically larger priority code).
If not, but contained in a format with the same priority.
a different value of alternative between these formats
also selects the parens format.
So does a negative alternative value.
Otherwise the noparens format is printed.
So one can automatically diferentiate between
The priority of the outermost level, when initially calling
In contrast to most other format classes,
the preparatory calculations of the format's width requirements are
only heuristical and use the respective maximum values,
because the final print context is (naturally) not known.Format.FormatPrinter.startPrinting(Format), is set to zero.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.format.Format
Format.Annotated<A>, Format.Append, Format.Beneath, Format.Beside, Format.Block, Format.BoundVariable, Format.Comment, Format.Compound, Format.Context, Format.Empty, Format.FormatPrinter, Format.FreeVariable, Format.Line, Format.Literal, Format.Markup, Format.Matcher, Format.NonFormatPrinter, Format.Prior, Format.Rewriter, Format.Space, Format.Subst, Format.Tabular, Format.Variable, Format.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe paren version will be printed if this format is contained (maybe indirectly) in another Prior with same priority and different alternative, or if this alternative == -1.final intThe paren version will be printed if this format is contained (maybe indirectly) in another Prior with higher priority.final Formatfinal FormatFields inherited from class eu.bandm.tools.format.Format
comma, DEFAULT_WIDTH, dot, empty, ground, ILLEGAL_IN_LITERAL, indent, INDENT_NOT_SET, isAlwaysMultiline, LENGTH_PREFIX, maxWidth, minWidth, space -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSets all fields of the new instance, but the indentation toFormat.INDENT_NOT_SET.protectedSets all fields of the new instance. -
Method Summary
Modifier and TypeMethodDescriptiondebugPrefix(int n) Overridden by subclasses to deliver a printable representation for debugging purpose.protected voidOver-ridden by all sub-classes of Format, for performing the adquate print operations.indent(int i) Returns a clone ofthiswith the new value ofFormat.indent.Methods inherited from class eu.bandm.tools.format.Format
annotated, append, append, apply, apply, apply, apply, applyPartial, applyTo, applyTo, beneath, beneath, beside, beside, block, block, comment, comment, comment, comment, eval, format, indentIsSet, isSpace, isValidContentForLiteral, line, line, literal, markup, markupLeft, markupRight, maxOfMins, of, printFormat, printFormat, printNonFormat, prior, prior, server, showLn, space, subst, subst, subst, tabular, tabular, toObjString, toString, toString, variable, variable
-
Field Details
-
level
public final int levelThe paren version will be printed if this format is contained (maybe indirectly) in another Prior with higher priority. -
alternative
public final int alternativeThe paren version will be printed if this format is contained (maybe indirectly) in another Prior with same priority and different alternative, or if this alternative == -1. -
noparens
-
parens
-
-
Constructor Details
-
Prior
Sets all fields of the new instance. -
Prior
Sets all fields of the new instance, but the indentation toFormat.INDENT_NOT_SET.
-
-
Method Details
-
debugPrefix
Description copied from class:FormatOverridden by subclasses to deliver a printable representation for debugging purpose.- Specified by:
debugPrefixin classFormat- Parameters:
n- the maximal number of characters
-
doprint
Description copied from class:FormatOver-ridden by all sub-classes of Format, for performing the adquate print operations. To be printed is the raison d'ĂȘtre of Format objects. These methods do not use the Visitor/Matcher framework, but direct method invocation and basic method dispatch for descending to child nodes. -
indent
Description copied from class:FormatReturns a clone ofthiswith the new value ofFormat.indent. (The built-in "clone()" functionality cannot be used, since field "indent" is final).
-