Package eu.bandm.tools.format.spi
Class SimpleFormatProvider
java.lang.Object
eu.bandm.tools.format.spi.SimpleFormatProvider
- All Implemented Interfaces:
FormatProvider<String>
Trivial implementation.
This class is useful for resolving package dependency circles, such that the real implementation can depend on modules that contain format-producing code themselves.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a compound format object that concatenates the given elements horizontally with absolute indentation.Returns a compound format object that concatenates the given elements vertically.Returns a compound format object that concatenates the given elements horizontally with relative indentation.Returns a compound format object that concatenates the given elements first horizontally and then vertically.Returns a compound format object that concatenates the given elements either horizontally or vertically.Returns an atomic format object that displays the given string.space
(int width) Returns an atomic format object that displays breakable whitespace.
-
Constructor Details
-
SimpleFormatProvider
public SimpleFormatProvider()Create a new instance.
-
-
Method Details
-
literal
Returns an atomic format object that displays the given string.If the given string contains whitespace, that will not be considered for line breaks.
- Specified by:
literal
in interfaceFormatProvider<String>
- Parameters:
text
- the string to display- Returns:
- an atomic format object that displays the given string
-
space
Returns an atomic format object that displays breakable whitespace.- Specified by:
space
in interfaceFormatProvider<String>
- Parameters:
width
- the number of whitespace characters to display- Returns:
- an atomic format object that displays breakable whitespace of the given width
-
append
Returns a compound format object that concatenates the given elements horizontally with absolute indentation.- Specified by:
append
in interfaceFormatProvider<String>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
beside
Returns a compound format object that concatenates the given elements horizontally with relative indentation.- Specified by:
beside
in interfaceFormatProvider<String>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
beneath
Returns a compound format object that concatenates the given elements vertically.- Specified by:
beneath
in interfaceFormatProvider<String>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
line
Returns a compound format object that concatenates the given elements either horizontally or vertically.- Specified by:
line
in interfaceFormatProvider<String>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-
block
Returns a compound format object that concatenates the given elements first horizontally and then vertically.- Specified by:
block
in interfaceFormatProvider<String>
- Parameters:
elems
- the format subobjects to concatenate- Returns:
- a concatenated compound format object
-