Package eu.bandm.tools.format
Class Empty
java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Empty
- All Implemented Interfaces:
Formattable,Serializable,Cloneable
A format which prints as an empty string in any printing context.
Needed for instance in "case" expressions, when one alternative shall
produce no output at all.
- See Also:
-
Field Summary
Fields inherited from class eu.bandm.tools.format.Format
comma, DEFAULT_WIDTH, dot, empty, indent, INDENT_NOT_SET, LENGTH_PREFIX, space -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty()Constructor, leaving the indentation unspecified. -
Method Summary
Modifier and TypeMethodDescriptiondebugPrefix(int n) Deliver the concatenation of the text contents, limited by the given number of characters, approximately.protected voidOver-ridden by all sub-classes of Format, for performing the print operations.indent(int i) Indentation of an empty format is not considered by the printing visitors, so that empty formats can safely be dropped when compressing the argument lists for compounds.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, checkValidIndent, comment, comment, comment, comment, eval, format, getIndent, ground, indentIsSet, isAlwaysMultiline, isSpace, line, line, literal, markup, markupLeft, markupRight, maxOfMins, maxWidth, minWidth, of, printFormat, printFormat, printNonFormat, prior, prior, properties, server, showLn, space, subst, subst, subst, tabular, tabular, toObjString, toString, toString, variable, variable
-
Constructor Details
-
Empty
protected Empty()Constructor, leaving the indentation unspecified.
-
-
Method Details
-
doprint
Description copied from class:FormatOver-ridden by all sub-classes of Format, for performing the print operations. -
debugPrefix
Description copied from class:FormatDeliver the concatenation of the text contents, limited by the given number of characters, approximately. Useful for debugging purpose.- Specified by:
debugPrefixin classFormat- Parameters:
n- the maximal number of characters which can be generated per tree node.- Returns:
- the concatenated, unformatted text contents.
-
indent
Indentation of an empty format is not considered by the printing visitors, so that empty formats can safely be dropped when compressing the argument lists for compounds. Since empty formats can come into play spontaneously, when a variable is replaced, there is no error message when the indentation is set, but silent dropping.- Specified by:
indentin classFormat- Parameters:
i- the new value for indent.- Returns:
- an new format with identical values but i, or this, if i is its indent value.
- Throws:
IllegalArgumentException- if ident value not valid, seeFormat.checkValidIndent(int)
-