Package eu.bandm.tools.format
Class Annotated<A>
java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Annotated<A>
- Type Parameters:
A- the type of the the annotated data
- All Implemented Interfaces:
Formattable,Serializable,Cloneable
- Direct Known Subclasses:
ReferenceFormat
Realizes a data annotation. Each instance combines some format
content with some data value.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AThe annotation value.protected final FormatThe printable contents which shall be annotated.Fields inherited from class eu.bandm.tools.format.Format
comma, DEFAULT_WIDTH, dot, empty, indent, INDENT_NOT_SET, LENGTH_PREFIX, space -
Constructor Summary
Constructors -
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.Return the result of replacing all variables with the bindings in the given context.Getter used by diagnosis.Getter used by diagnosis.indent(int i) Set the indentation intedend for the rendering of this foramt.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, 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
-
Field Details
-
format
The printable contents which shall be annotated. -
annotation
The annotation value.
-
-
Constructor Details
-
Annotated
Sole Constructor.(An annotated format is transparent for printing and thus carries no own indentation value.)
- Parameters:
format- to be annotated with the given dataannotation- the data to annotate to the given format
-
-
Method Details
-
doprint
Description copied from class:FormatOver-ridden by all sub-classes of Format, for performing the print operations. -
indent
Set the indentation intedend for the rendering of this foramt. An annotated format is transparent for printing and thus carries no own indentation value. Therefore this intention is propagated to the contained format.- Specified by:
indentin classFormat- Parameters:
i- new indentation value- 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)
-
eval
Description copied from class:FormatReturn the result of replacing all variables with the bindings in the given context.- Overrides:
evalin classFormat- Parameters:
c- defines the replacement for variables by name and number.partial- decides when a Variable not defined in the context is found: if true the Variable stays aunaltered; if false an IllegalArgumentException is thrown.- Returns:
- a format with all or some variables replaced
-
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.
-
getFormat
Getter used by diagnosis.- Returns:
- the format which is annotated
-
getAnnotation
Getter used by diagnosis.- Returns:
- the annotated data
-