Class ColumnFormatMetrics
java.lang.Object
org.refcodes.textual.ColumnWidthMetrics
org.refcodes.textual.ColumnFormatMetrics
- All Implemented Interfaces:
ColumnWidthAccessor, ColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>, ColumnWidthAccessor.ColumnWidthMutator, ColumnWidthAccessor.ColumnWidthProperty, HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<ColumnFormatMetrics>, HorizAlignTextModeAccessor.HorizAlignTextModeMutator, MoreTextModeAccessor.MoreTextModeBuilder<ColumnFormatMetrics>, MoreTextModeAccessor.MoreTextModeMutator, SplitTextModeAccessor.SplitTextModeBuilder<ColumnFormatMetrics>, SplitTextModeAccessor.SplitTextModeMutator, TextFormatModeAccessor.TextFormatModeBuilder<ColumnFormatMetrics>, TextFormatModeAccessor.TextFormatModeMutator
- Direct Known Subclasses:
ColumnSetupMetrics
public class ColumnFormatMetrics
extends ColumnWidthMetrics
implements SplitTextModeAccessor.SplitTextModeMutator, SplitTextModeAccessor.SplitTextModeBuilder<ColumnFormatMetrics>, TextFormatModeAccessor.TextFormatModeMutator, TextFormatModeAccessor.TextFormatModeBuilder<ColumnFormatMetrics>, HorizAlignTextModeAccessor.HorizAlignTextModeMutator, HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<ColumnFormatMetrics>, MoreTextModeAccessor.MoreTextModeMutator, MoreTextModeAccessor.MoreTextModeBuilder<ColumnFormatMetrics>
Implementation of column format metrics.
This class contains all behavior formerly defined as default methods in
ColumnFormatMetrics. It is intended to fully supplement (and later
replace) the interface as the primary implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ColumnWidthAccessor
ColumnWidthAccessor.ColumnWidthBuilder<B>, ColumnWidthAccessor.ColumnWidthMutator, ColumnWidthAccessor.ColumnWidthProperty -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new column format metrics.ColumnFormatMetrics(int aWidth, ColumnWidthType aWidthType) Constructs a column's width, either in percent (%) or in number of chars. -
Method Summary
Modifier and TypeMethodDescriptionvoidfromColumnFormatMetrics(ColumnFormatMetrics aColumnFormatMetrics) Copies all column format metrics from the provided instance.Returns the ANSI Escape-Code for the header.Gets the ANSI Escape-Code factory for the header.Gets the alignment mode for the header.Gets the more-text mode for the header.Returns theSplitTextModefor the header.Returns theTextFormatModefor the header.Returns the ANSI Escape-Code for the rows.Gets the ANSI Escape-Code factory for the row.Gets the alignment mode for the row.Gets the more-text mode for the row.Returns theSplitTextModefor the row.Returns theTextFormatModefor the row.voidsetEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the header and the rows.voidsetEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the header and the rows.voidsetHeaderEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the header.voidsetHeaderEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the header.voidsetHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets an alignment mode for the header.voidsetHeaderMoreTextMode(MoreTextMode aMoreTextMode) Sets a more-text mode for the header.voidsetHeaderSplitTextMode(SplitTextMode aSplitTextMode) Sets theSplitTextModefor the header.voidsetHeaderTextFormatMode(TextFormatMode aTextFormatMode) Sets theTextFormatModefor the header.voidsetHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets the horizontal align text mode for the horizontal align text mode property.voidsetMoreTextMode(MoreTextMode aMoreTextMode) Sets the more-text mode for the more-text mode property.voidsetRowEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the rows.voidsetRowEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the row.voidsetRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets an alignment mode for the row.voidsetRowMoreTextMode(MoreTextMode aMoreTextMode) Sets a more-text mode for the row.voidsetRowSplitTextMode(SplitTextMode aSplitTextMode) Sets theSplitTextModefor the row.voidsetRowTextFormatMode(TextFormatMode aTextFormatMode) Sets theTextFormatModefor the row.voidsetSplitTextMode(SplitTextMode aSplitTextMode) Sets the split-text mode for the split-text mode property.voidsetTextFormatMode(TextFormatMode aTextFormatMode) Sets the text-format mode for the text-format mode property.toHeaderEscapeCode(Object aIdentifier) Determines the ANSI Escape-Code for the header by evaluating the provided identifier.toRowEscapeCode(Object aIdentifier) Determines the ANSI Escape-Code for the row by evaluating the provided identifier.withColumnWidth(int aColumnWidth) Sets the column width and returns this instance as of the Builder-Pattern.withColumnWidthType(ColumnWidthType aColumnWidthType) Sets the column width type and returns this instance as of the Builder-Pattern.withEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the header and the rows and returns this instance as of the Builder-Pattern.withEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the header and the rows and returns this instance as of the Builder-Pattern.withHeaderEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the header and returns this instance as of the Builder-Pattern.withHeaderEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the header and the rows and returns thisColumnFormatMetricsinstance as of the Builder-Pattern.withHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets an alignment mode for the header and returns this instance as of the Builder-Pattern.withHeaderMoreTextMode(MoreTextMode aMoreTextMode) Sets a more-text mode for the header and returns this instance as of the Builder-Pattern.withHeaderSplitTextMode(SplitTextMode aSplitTextMode) Sets theSplitTextModefor the header and returns this instance as of the Builder-Pattern.withHeaderTextFormatMode(TextFormatMode aTextFormatMode) Sets theTextFormatModefor the header and returns this instance as of the Builder-Pattern.withHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets the horizontal align text mode for the horizontal align text mode property.withMoreTextMode(MoreTextMode aMoreTextMode) Sets the more-text mode for the more-text mode property.withRowEscapeCode(String aEscapeCode) Sets an ANSI Escape-Code for the rows and returns this instance as of the Builder-Pattern.withRowEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory) Sets an ANSI Escape-Code factory for the row and the rows and returns thisColumnFormatMetricsinstance as of the Builder-Pattern.withRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) Sets an alignment mode for the row and returns this instance as of the Builder-Pattern.withRowMoreTextMode(MoreTextMode aMoreTextMode) Sets a more-text mode for the row and returns this instance as of the Builder-Pattern.withRowSplitTextMode(SplitTextMode aSplitTextMode) Sets theSplitTextModefor the row and returns this instance as of the Builder-Pattern.withRowTextFormatMode(TextFormatMode aTextFormatMode) Sets theTextFormatModefor the row and returns this instance as of the Builder-Pattern.withSplitTextMode(SplitTextMode aSplitTextMode) Sets the split-text mode for the split-text mode property.withTextFormatMode(TextFormatMode aTextFormatMode) Sets the text-format mode for the text-format mode property.Methods inherited from class ColumnWidthMetrics
fromColumnWidthMetrics, getColumnWidth, getColumnWidthType, setColumnWidth, setColumnWidthType, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ColumnWidthAccessor.ColumnWidthProperty
letColumnWidth
-
Constructor Details
-
ColumnFormatMetrics
public ColumnFormatMetrics()Instantiates a new column format metrics. -
ColumnFormatMetrics
Constructs a column's width, either in percent (%) or in number of chars.- Parameters:
aWidth- The width for the column, either in percent (%) or in number of chars, depending on the providedColumnWidthType.aWidthType- The type of the width being provided.
-
-
Method Details
-
withHeaderEscapeCodeFactory
Sets an ANSI Escape-Code factory for the header and the rows and returns thisColumnFormatMetricsinstance as of the Builder-Pattern. In case an ANSI Escape-Code has been determined by theEscapeCodeFactory, then the ANSI Escape-Code is prepended and an ANSI Reset-Code is appended to the according text being printed.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used for determining ANSI escaping.- Returns:
- the column format metrics
-
withRowEscapeCodeFactory
Sets an ANSI Escape-Code factory for the row and the rows and returns thisColumnFormatMetricsinstance as of the Builder-Pattern. In case an ANSI Escape-Code has been determined by theEscapeCodeFactory, then the ANSI Escape-Code is prepended and an ANSI Reset-Code is appended to the according text being printed.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used for determining ANSI escaping.- Returns:
- the column format metrics
-
withColumnWidth
Sets the column width and returns this instance as of the Builder-Pattern.- Specified by:
withColumnWidthin interfaceColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>- Overrides:
withColumnWidthin classColumnWidthMetrics- Parameters:
aColumnWidth- The column width to be set.- Returns:
- This instance to continue configuration.
-
withColumnWidthType
Sets the column width type and returns this instance as of the Builder-Pattern.- Overrides:
withColumnWidthTypein classColumnWidthMetrics- Parameters:
aColumnWidthType- The column width type.- Returns:
- This instance to continue configuration.
-
withEscapeCode
Sets an ANSI Escape-Code for the header and the rows and returns this instance as of the Builder-Pattern.- Parameters:
aEscapeCode- TheStringto be used for ANSI escaping.- Returns:
- This instance to continue configuration.
-
setEscapeCode
-
withEscapeCodeFactory
Sets an ANSI Escape-Code factory for the header and the rows and returns this instance as of the Builder-Pattern.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used.- Returns:
- This instance to continue configuration.
-
setEscapeCodeFactory
Sets an ANSI Escape-Code factory for the header and the rows.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used.
-
withHeaderEscapeCode
Sets an ANSI Escape-Code for the header and returns this instance as of the Builder-Pattern.- Parameters:
aEscapeCode- TheStringto be used for ANSI escaping.- Returns:
- This instance to continue configuration.
-
setHeaderEscapeCode
-
getHeaderEscapeCode
-
withRowEscapeCode
Sets an ANSI Escape-Code for the rows and returns this instance as of the Builder-Pattern.- Parameters:
aEscapeCode- TheStringto be used for ANSI escaping.- Returns:
- This instance to continue configuration.
-
setRowEscapeCode
-
getRowEscapeCode
-
setHeaderEscapeCodeFactory
Sets an ANSI Escape-Code factory for the header.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used.
-
getHeaderEscapeCodeFactory
Gets the ANSI Escape-Code factory for the header.- Returns:
- The
EscapeCodeFactory.
-
toHeaderEscapeCode
-
setRowEscapeCodeFactory
Sets an ANSI Escape-Code factory for the row.- Parameters:
aEscapeCodeFactory- TheEscapeCodeFactoryto be used.
-
getRowEscapeCodeFactory
Gets the ANSI Escape-Code factory for the row.- Returns:
- The
EscapeCodeFactory.
-
toRowEscapeCode
-
withHorizAlignTextMode
Sets the horizontal align text mode for the horizontal align text mode property.- Specified by:
withHorizAlignTextModein interfaceHorizAlignTextModeAccessor.HorizAlignTextModeBuilder<ColumnFormatMetrics>- Parameters:
aHorizAlignTextMode- The horizontal align text mode to be stored by the font style property.- Returns:
- The builder for applying multiple build operations.
-
setHorizAlignTextMode
Sets the horizontal align text mode for the horizontal align text mode property.- Specified by:
setHorizAlignTextModein interfaceHorizAlignTextModeAccessor.HorizAlignTextModeMutator- Parameters:
aHorizAlignTextMode- The horizontal align text mode to be stored by the font style property.
-
withHeaderHorizAlignTextMode
Sets an alignment mode for the header and returns this instance as of the Builder-Pattern.- Parameters:
aHorizAlignTextMode- TheHorizAlignTextModeto be used for aligning the text.- Returns:
- This instance to continue configuration.
-
setHeaderHorizAlignTextMode
Sets an alignment mode for the header.- Parameters:
aHorizAlignTextMode- TheHorizAlignTextModeto be used for aligning the text.
-
getHeaderHorizAlignTextMode
Gets the alignment mode for the header.- Returns:
- The
HorizAlignTextMode.
-
withRowHorizAlignTextMode
Sets an alignment mode for the row and returns this instance as of the Builder-Pattern.- Parameters:
aHorizAlignTextMode- TheHorizAlignTextModeto be used for aligning the text.- Returns:
- This instance to continue configuration.
-
setRowHorizAlignTextMode
Sets an alignment mode for the row.- Parameters:
aHorizAlignTextMode- TheHorizAlignTextModeto be used for aligning the text.
-
getRowHorizAlignTextMode
Gets the alignment mode for the row.- Returns:
- The
HorizAlignTextMode.
-
withMoreTextMode
Sets the more-text mode for the more-text mode property.- Specified by:
withMoreTextModein interfaceMoreTextModeAccessor.MoreTextModeBuilder<ColumnFormatMetrics>- Parameters:
aMoreTextMode- The more-text mode to be stored by the more-text mode property.- Returns:
- The builder for applying multiple build operations.
-
setMoreTextMode
Sets the more-text mode for the more-text mode property.- Specified by:
setMoreTextModein interfaceMoreTextModeAccessor.MoreTextModeMutator- Parameters:
aMoreTextMode- The more-text mode to be stored by the more-text mode property.
-
withHeaderMoreTextMode
Sets a more-text mode for the header and returns this instance as of the Builder-Pattern.- Parameters:
aMoreTextMode- TheMoreTextModeto be used for truncating the text.- Returns:
- This instance to continue configuration.
-
setHeaderMoreTextMode
Sets a more-text mode for the header.- Parameters:
aMoreTextMode- TheMoreTextModeto be used for truncating the text.
-
getHeaderMoreTextMode
Gets the more-text mode for the header.- Returns:
- The
MoreTextMode.
-
withRowMoreTextMode
Sets a more-text mode for the row and returns this instance as of the Builder-Pattern.- Parameters:
aMoreTextMode- TheMoreTextModeto be used for truncating the text.- Returns:
- This instance to continue configuration.
-
setRowMoreTextMode
Sets a more-text mode for the row.- Parameters:
aMoreTextMode- TheMoreTextModeto be used for truncating the text.
-
getRowMoreTextMode
Gets the more-text mode for the row.- Returns:
- The
MoreTextMode.
-
withTextFormatMode
Sets the text-format mode for the text-format mode property.- Specified by:
withTextFormatModein interfaceTextFormatModeAccessor.TextFormatModeBuilder<ColumnFormatMetrics>- Parameters:
aTextFormatMode- The text-format mode to be stored by the text-format mode property.- Returns:
- The builder for applying multiple build operations.
-
setTextFormatMode
Sets the text-format mode for the text-format mode property.- Specified by:
setTextFormatModein interfaceTextFormatModeAccessor.TextFormatModeMutator- Parameters:
aTextFormatMode- The text-format mode to be stored by the text-format mode property.
-
withHeaderTextFormatMode
Sets theTextFormatModefor the header and returns this instance as of the Builder-Pattern.- Parameters:
aTextFormatMode- TheTextFormatModeto be set for the header.- Returns:
- This instance to continue configuration.
-
setHeaderTextFormatMode
Sets theTextFormatModefor the header.- Parameters:
aTextFormatMode- TheTextFormatModeto be set for the header.
-
getHeaderTextFormatMode
Returns theTextFormatModefor the header.- Returns:
- The
TextFormatMode.
-
withRowTextFormatMode
Sets theTextFormatModefor the row and returns this instance as of the Builder-Pattern.- Parameters:
aTextFormatMode- TheTextFormatModeto be set for the row.- Returns:
- This instance to continue configuration.
-
setRowTextFormatMode
Sets theTextFormatModefor the row.- Parameters:
aTextFormatMode- TheTextFormatModeto be set for the row.
-
getRowTextFormatMode
Returns theTextFormatModefor the row.- Returns:
- The
TextFormatMode.
-
withSplitTextMode
Sets the split-text mode for the split-text mode property.- Specified by:
withSplitTextModein interfaceSplitTextModeAccessor.SplitTextModeBuilder<ColumnFormatMetrics>- Parameters:
aSplitTextMode- The split-text mode to be stored by the split-text mode property.- Returns:
- The builder for applying multiple build operations.
-
setSplitTextMode
Sets the split-text mode for the split-text mode property.- Specified by:
setSplitTextModein interfaceSplitTextModeAccessor.SplitTextModeMutator- Parameters:
aSplitTextMode- The split-text mode to be stored by the split-text mode property.
-
withHeaderSplitTextMode
Sets theSplitTextModefor the header and returns this instance as of the Builder-Pattern.- Parameters:
aSplitTextMode- TheSplitTextModeto be set for the header.- Returns:
- This instance to continue configuration.
-
setHeaderSplitTextMode
Sets theSplitTextModefor the header.- Parameters:
aSplitTextMode- TheSplitTextModeto be set for the header.
-
getHeaderSplitTextMode
Returns theSplitTextModefor the header.- Returns:
- The
SplitTextMode.
-
withRowSplitTextMode
Sets theSplitTextModefor the row and returns this instance as of the Builder-Pattern.- Parameters:
aSplitTextMode- TheSplitTextModeto be set for the row.- Returns:
- This instance to continue configuration.
-
setRowSplitTextMode
Sets theSplitTextModefor the row.- Parameters:
aSplitTextMode- TheSplitTextModeto be set for the row.
-
getRowSplitTextMode
Returns theSplitTextModefor the row.- Returns:
- The
SplitTextMode.
-
fromColumnFormatMetrics
Copies all column format metrics from the provided instance.- Parameters:
aColumnFormatMetrics- The source metrics.
-