public abstract static class Format.Compound extends Format
startMutation()
and gets an intermediate clone.
getSubs()
and replace/delete/re-arrange the formats contained therein.
endMutation()
you get as a result
either the clone, or the original compound format object, if this is
appropriate.
Format.invalid
Before printing, the print method has to call Format.validate()
.
This in turn possibly calls recursivel validate() on the sub-formats
and Format.update()
to re-calculate the attribute caches.
startMutation()
and endMutation()
are called
in a not strictly alternating sequence, of when a "set" is attempted while
isMutating()
delivers false, then a
IllegalStateException
is thrown.
variables
are substituted by executing
eval()
!Format.Annotated<A>, Format.Append, Format.Beneath, Format.Beside, Format.Block, Format.BoundVariable, Format.Comment, Format.Compound, Format.Context, Format.Empty, Format.Forester, Format.FormatPrinter, Format.FreeVariable, Format.Line, Format.Literal, Format.Markup, Format.Matcher, Format.MayBreak, Format.NonFormatPrinter, Format.Prior, Format.Rewriter, Format.Space, Format.Subst, Format.Tabular, Format.Variable, Format.Visitor
Modifier and Type | Field and Description |
---|---|
protected List<Format> |
subs |
comma, contentPrefixPrinted, DEFAULT_WIDTH, dot, empty, ground, indent, INDENT_NOT_SET, invalid, isAlwaysMultiline, LENGTH_PREFIX, literal, maxWidth, minWidth, pattern_illegal_literal, pattern_newline, pattern_ws, pattern_wsWithVars, space
format
Modifier | Constructor and Description |
---|---|
protected |
Compound()
For deserialization only.
|
protected |
Compound(List<Format> f) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
calcground()
returns the "and" of all sub-formats.
|
protected boolean |
calcmult()
returns the "or" of all sub-formats.
|
String |
debugPrefix(int n) |
Format.Compound |
endMutation()
See description of the mutation mechanism at
class level . |
Format |
eval(Format.Context c,
boolean partial) |
List<Format> |
getSubs()
Returns a list which is modifiable only if it comes from a
cloned Format.Compound, created with "startMutation()" as described at
class level . |
boolean |
isMutating()
See description of the mutation mechanism at
class level . |
Format.Compound |
startMutation()
See description of the mutation mechanism at
class level . |
protected int |
sumMin_noTrailingBlanks() |
protected void |
update()
Just local calculation, assumes that all sub-objects are already valid.
|
protected void |
validate()
Re-calculates all parameters
by calling
Format.update() , iff necessary. |
annotated, append, append, apply, apply, apply, apply, applyPartial, applyTo, applyTo, beneath, beneath, beside, beside, block, block, calcmax, calcmin, comment, comment, comment, comment, doprint, format, indent, indentIsSet, invalidate, isSpace, isValidContentForLiteral, line, line, list, list, list, list, list, literal, main, makeAppend, makeBeneath, makeBeside, makeBlock, makeLine, makeTabular, markup, markupLeft, markupRight, printFormat, printFormat, printNonFormat, prior, prior, quoteDTDstyle, quoteJavaStyle, showLn, showLn, showSwingTree, space, subst, subst, subst, tabular, tabular, text, textWithVars, toFormat, toObjString, toString, toString, variable, variable
protected int sumMin_noTrailingBlanks()
protected boolean calcmult()
protected boolean calcground()
calcground
in class Format
protected void validate()
Format
Format.update()
, iff necessary.
Is over-ridden by Format.Compound
for prior descending to sub-formats.public Format.Compound startMutation()
class level
.IllegalStateException
- when applied to a compound
which itself is already a clone.public Format.Compound endMutation()
class level
.IllegalStateException
- when applied to a compound
which is not a clone. subs.size()>=2
wird hier NICHT eingehalten !! FIXME public boolean isMutating()
class level
.protected void update()
Format
Format.Compound
, testing not being a
temporary copy). Instead, the differente "calc<..>
" methods
are overridden individually.public List<Format> getSubs()
class level
.
The set() method of the returned list throws
IllegalStateException
if it comes from a non-clone.public Format eval(Format.Context c, boolean partial)
public String debugPrefix(int n)
debugPrefix
in class Format
see also the complete user documentation .