Package eu.bandm.tools.format
Class Format.Comment
java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Format.Compound
eu.bandm.tools.format.Format.Comment
- All Implemented Interfaces:
Formattable
,Serializable
,Cloneable
- Enclosing class:
- Format
Arranges all sub-formats with leading asterisks, like a javadoc comment.
Arranges all sub-formats in a text block which is smaller than usual, and
prepends the comment-lead in prefix after each linefeed printed.
This format is special because the line prefices must be inserted
"physically" into the lower level "block" or "beneath" layout. always at the
start of a line. Therefore they are handled by the
Format.FormatPrinter
directly.
This has only one field for this purpose, thus Comments can NOT BE NESTED.
This is checked not before trying to print.- 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.Compound
subs
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
-
Method Summary
Modifier and TypeMethodDescriptionUnsupported Operation.protected void
Over-ridden by all sub-classes of Format, for performing the adquate print operations.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.Compound
debugPrefix, eval, 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, 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
-
prefix
-
suffix
-
linePrefix
-
-
Constructor Details
-
Comment
protected Comment(@Opt @Opt String prefix, String linePrefix, @Opt @Opt String suffix, List<Format> f) Constructor used by the factory methods. -
Comment
protected Comment(int i, int a, boolean m, boolean g, int ind, String prefix, String linePrefix, String suffix, List<Format> f) Constructor used only internally by the cloning methods.
-
-
Method Details
-
constructor
Unsupported Operation. Comment is a Compound, but it is special as it is not freely compositinal. It thus has no corresponding CompoundConstructor.- Specified by:
constructor
in classFormat.Compound
-
mutate
Description copied from class:Format.Compound
Creates a new instance of the same class as this, with sub-formats altered by the given consumer function.- Specified by:
mutate
in classFormat.Compound
-
doprint
Description copied from class:Format
Over-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.
-