org.refcodes.mixin.ColumnWidthAccessor
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<HorizAlignTextBuilder>
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
, FillCharAccessor
, FillCharAccessor.FillCharBuilder<HorizAlignTextBuilder>
, FillCharAccessor.FillCharMutator
, FillCharAccessor.FillCharProperty
, HorizAlignTextModeAccessor
, HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<HorizAlignTextBuilder>
, HorizAlignTextModeAccessor.HorizAlignTextModeMutator
, HorizAlignTextModeAccessor.HorizAlignTextModeProperty
, Text<HorizAlignTextBuilder>
, TextAccessor
, TextAccessor.TextBuilder<HorizAlignTextBuilder>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
public class HorizAlignTextBuilder extends Object implements FillCharAccessor.FillCharProperty, FillCharAccessor.FillCharBuilder<HorizAlignTextBuilder>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<HorizAlignTextBuilder>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty, Text<HorizAlignTextBuilder>, HorizAlignTextModeAccessor.HorizAlignTextModeProperty, HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<HorizAlignTextBuilder>
HorizAlignTextMode
attribute.org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
FillCharAccessor.FillCharBuilder<B extends FillCharAccessor.FillCharBuilder<B>>, FillCharAccessor.FillCharMutator, FillCharAccessor.FillCharProperty
HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<B extends HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<B>>, HorizAlignTextModeAccessor.HorizAlignTextModeMutator, HorizAlignTextModeAccessor.HorizAlignTextModeProperty
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
HorizAlignTextBuilder() |
Modifier and Type | Method | Description |
---|---|---|
int |
getColumnWidth() |
|
char |
getFillChar() |
Retrieves the fill char from the fill char property.
|
HorizAlignTextMode |
getHorizAlignTextMode() |
Retrieves the horizontal align text mode from the horizontal align text
mode property.
|
String[] |
getText() |
Retrieves the text from the text property.
|
void |
setColumnWidth(int aColumnWidth) |
|
void |
setFillChar(char aFillChar) |
Sets the fill char for the fill char property.
|
void |
setHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) |
Sets the horizontal align text mode for the horizontal align text
mode property.
|
void |
setText(String... aText) |
Sets the text for the text property.
|
static String[] |
toAlign(String[] aText,
int aColumnWidth,
char aFillChar,
HorizAlignTextMode aHorizAlignTextMode) |
Fills a text array up on by appending the given char to the left and the
right till the given length is reached.
|
static String[] |
toAlign(String[] aText,
int aColumnWidth,
char aFillChar,
HorizAlignTextMode aHorizAlignTextMode,
boolean hasAnsiEscapeCodes) |
Fills a text array up on by appending the given char to the left and the
right till the given length is reached.
|
static String |
toAlign(String aText,
int aColumnWidth,
char aFillChar,
HorizAlignTextMode aHorizAlignTextMode) |
Fills a text up on by appending the given char to the left and the right
till the given length is reached.
|
static String |
toAlign(String aText,
int aColumnWidth,
char aFillChar,
HorizAlignTextMode aHorizAlignTextMode,
boolean hasAnsiEscapeCodes) |
Fills a text up on by appending the given char to the left and the right
till the given length is reached.
|
String |
toString() |
The
String being build by the builder upon the settings of
the attributes. |
String |
toString(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toString() . |
String[] |
toStrings() |
The
String s being build by the builder upon the settings of
the attributes. |
String[] |
toStrings(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings() . |
HorizAlignTextBuilder |
withColumnWidth(int aColumnWidth) |
|
HorizAlignTextBuilder |
withFillChar(char aFillChar) |
Sets the fill char for the fill char property.
|
HorizAlignTextBuilder |
withHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode) |
Sets the align text mode for the align text mode property.
|
B |
withText(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
letColumnWidth
letFillChar
letHorizAlignTextMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
letText, letText
toString
public HorizAlignTextBuilder withColumnWidth(int aColumnWidth)
withColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<HorizAlignTextBuilder>
public void setColumnWidth(int aColumnWidth)
setColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
public int getColumnWidth()
getColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor
public void setHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
setHorizAlignTextMode
in interface HorizAlignTextModeAccessor.HorizAlignTextModeMutator
aHorizAlignTextMode
- The horizontal align text mode to be
stored by the font style property.public HorizAlignTextMode getHorizAlignTextMode()
getHorizAlignTextMode
in interface HorizAlignTextModeAccessor
public char getFillChar()
getFillChar
in interface FillCharAccessor
public void setFillChar(char aFillChar)
setFillChar
in interface FillCharAccessor.FillCharMutator
aFillChar
- The fill char to be stored by the fill char
property.public String[] toStrings()
String
s being build by the builder upon the settings of
the attributes.toStrings
in interface TextAccessor.TextProvider
String
arraypublic String[] toStrings(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
. Implementation requirements: This
method must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
(do not change the text property) as
this would not be thread safe!toStrings
in interface Text<HorizAlignTextBuilder>
aText
- The text to be processed.String
arraypublic HorizAlignTextBuilder withHorizAlignTextMode(HorizAlignTextMode aHorizAlignTextMode)
withHorizAlignTextMode
in interface HorizAlignTextModeAccessor.HorizAlignTextModeBuilder<HorizAlignTextBuilder>
aHorizAlignTextMode
- The align text mode to be stored by the align
text mode property.public HorizAlignTextBuilder withFillChar(char aFillChar)
withFillChar
in interface FillCharAccessor.FillCharBuilder<HorizAlignTextBuilder>
aFillChar
- The fill char to be stored by the fill char
property.public static String toAlign(String aText, int aColumnWidth, char aFillChar, HorizAlignTextMode aHorizAlignTextMode)
aText
- The text to be filled up or aligned.aColumnWidth
- The length to be reached.aFillChar
- The char to be used for filling upaHorizAlignTextMode
- the horiz align text modeString
filled up with the given char till the width is
reached or the String
untouched in case no
HorizAlignTextMode
parameter has been provided..public static String[] toAlign(String[] aText, int aColumnWidth, char aFillChar, HorizAlignTextMode aHorizAlignTextMode)
aText
- The text array to be filled up or aligned.aColumnWidth
- The length to be reached.aFillChar
- The char to be used for filling upaHorizAlignTextMode
- the horiz align text modeString
filled up with the given char till the width is
reached or the String
untouched in case no
HorizAlignTextMode
parameter has been provided..public static String toAlign(String aText, int aColumnWidth, char aFillChar, HorizAlignTextMode aHorizAlignTextMode, boolean hasAnsiEscapeCodes)
aText
- The text to be filled up or aligned.aColumnWidth
- The length to be reached.aFillChar
- The char to be used for filling upaHorizAlignTextMode
- the horiz align text modehasAnsiEscapeCodes
- Whether to take any (non printable) ANSI escape
codes into account which would, when not being considered, cause
wrong results.String
filled up with the given char till the width is
reached or the String
untouched in case no
HorizAlignTextMode
parameter has been provided..public static String[] toAlign(String[] aText, int aColumnWidth, char aFillChar, HorizAlignTextMode aHorizAlignTextMode, boolean hasAnsiEscapeCodes)
aText
- The text array to be filled up or aligned.aColumnWidth
- The length to be reached.aFillChar
- The char to be used for filling upaHorizAlignTextMode
- the horiz align text modehasAnsiEscapeCodes
- Whether to take any (non printable) ANSI escape
codes into account which would, when not being considered, cause
wrong results.String
filled up with the given char till the width is
reached or the String
untouched in case no
HorizAlignTextMode
parameter has been provided..public String[] getText()
getText
in interface TextAccessor
public void setText(String... aText)
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
public B withText(Collection<String> aText)
withText
in interface TextAccessor.TextBuilder<B extends Text<B>>
aText
- the textpublic String toString()
String
being build by the builder upon the settings of
the attributes. In case more then one line has been set as input and
the functionality of the builder is applied to each line in separate,
then this method returns all of them lines concatenated with a line
break between each of them (implementation depended).toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
. Implementation requirements: This method
must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
(do not change the text property) as this
would not be thread safe!Copyright © 2021. All rights reserved.