Package eu.bandm.tools.format
Class Format.Compound
java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Format.Compound
- All Implemented Interfaces:
Formattable
,Serializable
,Cloneable
- Direct Known Subclasses:
Format.Append
,Format.Beneath
,Format.Beside
,Format.Block
,Format.Comment
,Format.Line
,Format.Tabular
- Enclosing class:
- Format
The base class for all formats which combine (= "contain") sub-formats.
- 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
Fields inherited from class eu.bandm.tools.format.Format
comma, DEFAULT_WIDTH, dot, empty, ground, indent, INDENT_NOT_SET, isAlwaysMultiline, LENGTH_PREFIX, maxWidth, minWidth, pattern_illegal_literal, space
-
Constructor Summary
ModifierConstructorDescriptionprotected
A constructor used by our (mere technical) "clone" replacementprotected
A constructorprotected
A constructorprotected
A constructor -
Method Summary
Modifier and TypeMethodDescription(package private) abstract CompoundConstructor
Delivers the reification of the constructor.debugPrefix
(int n) Overridden by subclasses to deliver a printable representation for debugging purpose.eval
(Format.Context c, boolean partial) Creates a new clone in which variables are replaced by their definition, according to the Context.indent
(int i) Returns a clone ofthis
with the new value ofFormat.indent
.abstract Format.Compound
Creates a new instance of the same class as this, with sub-formats altered by the given consumer function.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, doprint, format, indentIsSet, isSpace, isValidContentForLiteral, line, line, literal, makeAppend, makeBeneath, makeBeside, makeBlock, makeLine, makeTabular, 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
-
subs
All sub-formats. This list is unmodifiable.
-
-
Constructor Details
-
Compound
A constructor- Parameters:
f
- list of sub-formats, should not be empty
-
Compound
A constructor- Parameters:
i
- minwidtha
- maxnwidthf
- list of sub-formats, should not be empty
-
Compound
A constructor- Parameters:
i
- minwidtha
- maxnwidthm
- isMultiLinef
- list of sub-formats, should not be empty
-
Compound
A constructor used by our (mere technical) "clone" replacement- Parameters:
i
- minwidtha
- maxnwidthm
- is always multiLineg
- is groundindent
- indentationf
- list of sub-formats, should not be empty
-
-
Method Details
-
constructor
Delivers the reification of the constructor. That enum type has "apply()" methods which generate a corresponding instance. This is used for the implementation of "clone-with-overwrite", etc. -
indent
Description copied from class:Format
Returns a clone ofthis
with the new value ofFormat.indent
. (The built-in "clone()" functionality cannot be used, since field "indent" is final). -
mutate
Creates a new instance of the same class as this, with sub-formats altered by the given consumer function. -
eval
Creates a new clone in which variables are replaced by their definition, according to the Context. -
debugPrefix
Description copied from class:Format
Overridden by subclasses to deliver a printable representation for debugging purpose.- Specified by:
debugPrefix
in classFormat
- Parameters:
n
- the maximal number of characters
-