public class ColumnFormatMetricsImpl extends ColumnWidthMetricsImpl implements ColumnFormatMetrics
ColumnFormatMetrics
interface.org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
Constructor and Description |
---|
ColumnFormatMetricsImpl() |
ColumnFormatMetricsImpl(int aWidth,
ColumnWidthType aWidthType)
Constructs a column's width, either in percent (%) or in number of chars.
|
Modifier and Type | Method and Description |
---|---|
String |
getHeaderEscapeCode()
Returns the ANSI Escape-Code for the header.
|
EscapeCodeFactory |
getHeaderEscapeCodeFactory()
Gets the ANSI Escape-Code factory for the header.
|
HorizAlignTextMode |
getHeaderHorizAlignTextMode()
Gets the alignment mode for the header.
|
MoreTextMode |
getHeaderMoreTextMode()
Gets the alignment mode for the header.
|
SplitTextMode |
getHeaderSplitTextMode()
Returns the
SplitTextMode for the header. |
TextFormatMode |
getHeaderTextFormatMode()
Returns the
TextFormatMode for the header. |
String |
getRowEscapeCode()
Returns the ANSI Escape-Code for the rows and returns this
ColumnFormatMetrics instance as of the builder pattern. |
EscapeCodeFactory |
getRowEscapeCodeFactory()
Gets the ANSI Escape-Code factory for the row.
|
HorizAlignTextMode |
getRowHorizAlignTextMode()
Gets the alignment mode for the row.
|
MoreTextMode |
getRowMoreTextMode()
Gets the alignment mode for the row.
|
SplitTextMode |
getRowSplitTextMode()
Returns the
SplitTextMode for the row. |
TextFormatMode |
getRowTextFormatMode()
Returns the
TextFormatMode for the row. |
void |
setEscapeCode(String aEscapeCode)
Sets an ANSI Escape-Code for the header and the rows.
|
void |
setHeaderEscapeCode(String aEscapeCode)
Sets an ANSI Escape-Code for the header.
|
void |
setHeaderEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory)
Sets an ANSI Escape-Code factory for the header.
|
void |
setHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an alignment mode for the header.
|
void |
setHeaderMoreTextMode(MoreTextMode aMoreTextMode)
Sets a more-text mode for the header.
|
void |
setHeaderSplitTextMode(SplitTextMode aSplitTextMode)
Sets the
SplitTextMode for the header. |
void |
setHeaderTextFormatMode(TextFormatMode aTextFormatMode)
Sets the
TextFormatMode for the header. |
void |
setMoreTextMode(MoreTextMode aMoreTextMode)
Sets the more-text mode for the more-text mode property.
|
void |
setRowEscapeCode(String aEscapeCode)
Sets an ANSI Escape-Code for the rows and returns this
ColumnFormatMetrics instance as of the builder pattern. |
void |
setRowEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory)
Sets an ANSI Escape-Code factory for the row.
|
void |
setRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
Sets an alignment mode for the row.
|
void |
setRowMoreTextMode(MoreTextMode aMoreTextMode)
Sets a more-text mode for the row.
|
void |
setRowSplitTextMode(SplitTextMode aSplitTextMode)
Sets the
SplitTextMode for the row. |
void |
setRowTextFormatMode(TextFormatMode aTextFormatMode)
Sets the
TextFormatMode for the row. |
String |
toHeaderEscapeCode(Object aIdentifier)
Determines the ANSI Escape-Code by evaluating the provided ID: If an
EscapeCodeFactory has been set via
ColumnFormatMetrics.setEscapeCodeFactory(EscapeCodeFactory) and the factory returns
a value different to null, then this value is returned. |
String |
toRowEscapeCode(Object aIdentifier)
Determines the ANSI Escape-Code by evaluating the provided ID: If an
EscapeCodeFactory has been set via
ColumnFormatMetrics.setEscapeCodeFactory(EscapeCodeFactory) and the factory returns
a value different to null, then this value is returned. |
ColumnFormatMetrics |
withColumnWidth(int aColumnWidth) |
getColumnWidth, getColumnWidthType, setColumnWidth, setColumnWidthType, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fromColumnFormatMetrics, setEscapeCodeFactory, setHorizAlignTextMode, setSplitTextMode, setTextFormatMode, withColumnWidthType, withEscapeCode, withEscapeCodeFactory, withHeaderEscapeCode, withHeaderEscapeCodeFactory, withHeaderHorizAlignTextMode, withHeaderMoreTextMode, withHeaderSplitTextMode, withHeaderTextFormatMode, withHorizAlignTextMode, withMoreTextMode, withRowEscapeCode, withRowEscapeCodeFactory, withRowHorizAlignTextMode, withRowMoreTextMode, withRowSplitTextMode, withRowTextFormatMode, withSplitTextMode, withTextFormatMode
fromColumnWidthMetrics, getColumnWidthType, setColumnWidthType
public ColumnFormatMetricsImpl()
public ColumnFormatMetricsImpl(int aWidth, ColumnWidthType aWidthType)
aWidth
- The width for the column, either in percent (%) or in
number of chars, depending on the provided ColumnWidthType
.aWidthType
- The type of the width being provided, either percent
(%) or number of chars.public ColumnFormatMetrics withColumnWidth(int aColumnWidth)
withColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ColumnWidthMetrics>
withColumnWidth
in interface ColumnFormatMetrics
withColumnWidth
in class ColumnWidthMetricsImpl
public void setEscapeCode(String aEscapeCode)
ColumnFormatMetrics
setEscapeCode
in interface ColumnFormatMetrics
aEscapeCode
- The String
to be used for ANSI escaping.public void setHeaderEscapeCode(String aEscapeCode)
ColumnFormatMetrics
setHeaderEscapeCode
in interface ColumnFormatMetrics
aEscapeCode
- The String
to be used for ANSI escaping.public String getHeaderEscapeCode()
ColumnFormatMetrics
getHeaderEscapeCode
in interface ColumnFormatMetrics
String
to be used for ANSI escaping.public void setRowEscapeCode(String aEscapeCode)
ColumnFormatMetrics
ColumnFormatMetrics
instance as of the builder pattern. The
latest ANSI Escape-Code being set wins.setRowEscapeCode
in interface ColumnFormatMetrics
aEscapeCode
- The String
to be used for ANSI escaping.public String getRowEscapeCode()
ColumnFormatMetrics
ColumnFormatMetrics
instance as of the builder pattern. The
latest ANSI Escape-Code being set wins.getRowEscapeCode
in interface ColumnFormatMetrics
String
to be used for ANSI escaping.public void setMoreTextMode(MoreTextMode aMoreTextMode)
MoreTextModeAccessor.MoreTextModeMutator
setMoreTextMode
in interface ColumnFormatMetrics
setMoreTextMode
in interface MoreTextModeAccessor.MoreTextModeMutator
aMoreTextMode
- The more-text mode to be stored by the more-text
mode property.public void setHeaderHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
ColumnFormatMetrics
setHeaderHorizAlignTextMode
in interface ColumnFormatMetrics
aHorizAlignTextMode
- The HorizAlignTextMode
to be used for
aligning the text.public HorizAlignTextMode getHeaderHorizAlignTextMode()
ColumnFormatMetrics
getHeaderHorizAlignTextMode
in interface ColumnFormatMetrics
HorizAlignTextMode
to be used for aligning the text.public void setRowHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
ColumnFormatMetrics
setRowHorizAlignTextMode
in interface ColumnFormatMetrics
aHorizAlignTextMode
- The HorizAlignTextMode
to be used for
aligning the text.public HorizAlignTextMode getRowHorizAlignTextMode()
ColumnFormatMetrics
getRowHorizAlignTextMode
in interface ColumnFormatMetrics
HorizAlignTextMode
to be used for aligning the text.public void setHeaderMoreTextMode(MoreTextMode aMoreTextMode)
ColumnFormatMetrics
setHeaderMoreTextMode
in interface ColumnFormatMetrics
aMoreTextMode
- The MoreTextMode
to be used for truncating
the text.public MoreTextMode getHeaderMoreTextMode()
ColumnFormatMetrics
getHeaderMoreTextMode
in interface ColumnFormatMetrics
MoreTextMode
to be used for truncating the text.public void setRowMoreTextMode(MoreTextMode aMoreTextMode)
ColumnFormatMetrics
setRowMoreTextMode
in interface ColumnFormatMetrics
aMoreTextMode
- The MoreTextMode
to be used for truncating
the text.public MoreTextMode getRowMoreTextMode()
ColumnFormatMetrics
getRowMoreTextMode
in interface ColumnFormatMetrics
MoreTextMode
to be used for truncating the text.public void setHeaderTextFormatMode(TextFormatMode aTextFormatMode)
ColumnFormatMetrics
TextFormatMode
for the header.setHeaderTextFormatMode
in interface ColumnFormatMetrics
aTextFormatMode
- The TextFormatMode
to be set for the
header;public TextFormatMode getHeaderTextFormatMode()
ColumnFormatMetrics
TextFormatMode
for the header.getHeaderTextFormatMode
in interface ColumnFormatMetrics
TextFormatMode
to be set for the header;public void setRowTextFormatMode(TextFormatMode aTextFormatMode)
ColumnFormatMetrics
TextFormatMode
for the row.setRowTextFormatMode
in interface ColumnFormatMetrics
aTextFormatMode
- The TextFormatMode
to be set for the row;public TextFormatMode getRowTextFormatMode()
ColumnFormatMetrics
TextFormatMode
for the row.getRowTextFormatMode
in interface ColumnFormatMetrics
TextFormatMode
to be set for the row;public void setHeaderSplitTextMode(SplitTextMode aSplitTextMode)
ColumnFormatMetrics
SplitTextMode
for the header.setHeaderSplitTextMode
in interface ColumnFormatMetrics
aSplitTextMode
- The SplitTextMode
to be set for the header;public SplitTextMode getHeaderSplitTextMode()
ColumnFormatMetrics
SplitTextMode
for the header.getHeaderSplitTextMode
in interface ColumnFormatMetrics
SplitTextMode
to be set for the header;public void setRowSplitTextMode(SplitTextMode aSplitTextMode)
ColumnFormatMetrics
SplitTextMode
for the row.setRowSplitTextMode
in interface ColumnFormatMetrics
aSplitTextMode
- The SplitTextMode
to be set for the row;public SplitTextMode getRowSplitTextMode()
ColumnFormatMetrics
SplitTextMode
for the row.getRowSplitTextMode
in interface ColumnFormatMetrics
SplitTextMode
to be set for the row;public void setHeaderEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory)
ColumnFormatMetrics
setHeaderEscapeCodeFactory
in interface ColumnFormatMetrics
aEscapeCodeFactory
- The EscapeCodeFactory
to be used for
determining ANSI escaping.public EscapeCodeFactory getHeaderEscapeCodeFactory()
ColumnFormatMetrics
getHeaderEscapeCodeFactory
in interface ColumnFormatMetrics
EscapeCodeFactory
to be used for determining ANSI
escaping.public String toHeaderEscapeCode(Object aIdentifier)
ColumnFormatMetrics
EscapeCodeFactory
has been set via
ColumnFormatMetrics.setEscapeCodeFactory(EscapeCodeFactory)
and the factory returns
a value different to null, then this value is returned. Else the value
returned by ColumnFormatMetrics.getHeaderEscapeCode()
is returned as fallback.toHeaderEscapeCode
in interface ColumnFormatMetrics
aIdentifier
- The ID for which to lookup an Escape-Code.public void setRowEscapeCodeFactory(EscapeCodeFactory aEscapeCodeFactory)
ColumnFormatMetrics
setRowEscapeCodeFactory
in interface ColumnFormatMetrics
aEscapeCodeFactory
- The EscapeCodeFactory
to be used for
determining ANSI escaping. configuration.public EscapeCodeFactory getRowEscapeCodeFactory()
ColumnFormatMetrics
getRowEscapeCodeFactory
in interface ColumnFormatMetrics
EscapeCodeFactory
to be used for determining ANSI
escaping.public String toRowEscapeCode(Object aIdentifier)
ColumnFormatMetrics
EscapeCodeFactory
has been set via
ColumnFormatMetrics.setEscapeCodeFactory(EscapeCodeFactory)
and the factory returns
a value different to null, then this value is returned. Else the value
returned by ColumnFormatMetrics.getRowEscapeCode()
is returned as fallback.toRowEscapeCode
in interface ColumnFormatMetrics
aIdentifier
- The ID for which to lookup an Escape-Code.Copyright © 2017. All rights reserved.