Text<TruncateTextBuilder>
, TextAccessor
, TextAccessor.TextBuilder<TruncateTextBuilder>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
, TruncateTextBuilder
public class TruncateTextBuilderImpl extends Object implements TruncateTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
TruncateTextBuilderImpl() |
Modifier and Type | Method | Description |
---|---|---|
protected static void |
doStrip(StringBuffer aStringBuffer,
char aChar) |
Removes all leading and trailing chars identical with specified char ch.
|
protected static void |
doStripLeft(StringBuffer aStringBuffer,
char aChar) |
Removes all leading chars identical with specified char.
|
protected static void |
doStripRight(StringBuffer aStringBuffer,
char aChar) |
Removes all rear chars identical with specified char ch.
|
String[] |
getText() |
Retrieves the text from the text property.
|
char[] |
getTruncateChars() |
Retrieves the truncate chars from the truncate chars property.
|
TruncateTextMode |
getTruncateTextMode() |
Retrieves the truncate text mode from the truncate text mode property.
|
void |
setText(String... aText) |
Sets the text for the text property.
|
void |
setTruncateChars(char... aStripChars) |
Sets the truncate chars for the truncate chars property.
|
void |
setTruncateTextMode(TruncateTextMode aTruncateTextMode) |
Sets the truncate text mode for the truncate text mode property.
|
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() . |
protected static String |
toStrip(String aText,
char[] aChars) |
Returns a new String without leading nor trailing chars.
|
protected static String |
toStrip(String aText,
char[] aChars,
TruncateTextMode aTruncateTextMode) |
To strip.
|
protected static String |
toStripLeft(String aText,
char[] aChars) |
Returns a new String without leading chars.
|
protected static String |
toStripRight(String aText,
char[] aChars) |
Returns a new String without trailing chars.
|
B |
withText(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
toString, withStripChars, withText, withTruncateTextMode
public TruncateTextMode getTruncateTextMode()
getTruncateTextMode
in interface TruncateTextBuilder
public void setTruncateTextMode(TruncateTextMode aTruncateTextMode)
setTruncateTextMode
in interface TruncateTextBuilder
aTruncateTextMode
- The truncate text mode to be stored by the
truncate text mode property.public char[] getTruncateChars()
getTruncateChars
in interface TruncateTextBuilder
public void setTruncateChars(char... aStripChars)
setTruncateChars
in interface TruncateTextBuilder
aStripChars
- The truncate chars to be stored by the text align
mode property.public String[] toStrings()
String
s being build by the builder upon the settings of the
attributes.toStrings
in interface TextAccessor.TextProvider
toStrings
in interface TruncateTextBuilder
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<TruncateTextBuilder>
aText
- The text to be processed.String
arrayprotected static String toStrip(String aText, char[] aChars, TruncateTextMode aTruncateTextMode)
aText
- the textaChars
- the charsaTruncateTextMode
- the truncate text modeprotected static void doStripLeft(StringBuffer aStringBuffer, char aChar)
String
will be BBBAAABBB.aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static String toStripLeft(String aText, char[] aChars)
aText
- The text to be stripped.aChars
- the charsprotected static void doStripRight(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static void doStrip(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.protected static String toStripRight(String aText, char[] aChars)
aText
- Description is currently not available!aChars
- the charsprotected static String toStrip(String aText, char[] aChars)
aText
- The text to be stripped.aChars
- the charspublic 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 © 2018. All rights reserved.