public class TruncateTextBuilderImpl extends Object implements TruncateTextBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor and Description |
---|
TruncateTextBuilderImpl() |
Modifier and Type | Method and 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...) |
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...) |
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) |
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(Collection<String> aText)
Sets the text for the text property.
|
B |
withText(String... aText)
Sets the text for the text property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toString, withStripChars, withText, withTruncateTextMode
getText
setText, setText
withText
public TruncateTextMode getTruncateTextMode()
TruncateTextBuilder
getTruncateTextMode
in interface TruncateTextBuilder
public void setTruncateTextMode(TruncateTextMode aTruncateTextMode)
TruncateTextBuilder
setTruncateTextMode
in interface TruncateTextBuilder
aTruncateTextMode
- The truncate text mode to be stored by the
truncate text mode property.public char[] getTruncateChars()
TruncateTextBuilder
getTruncateChars
in interface TruncateTextBuilder
public void setTruncateChars(char... aStripChars)
TruncateTextBuilder
setTruncateChars
in interface TruncateTextBuilder
aStripChars
- The truncate chars to be stored by the text align
mode property.public String[] toStrings()
TruncateTextBuilder
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
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)
protected 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.protected 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!protected static String toStrip(String aText, char[] aChars)
aText
- The text to be stripped.public String[] getText()
TextAccessor
getText
in interface TextAccessor
public void setText(String... aText)
TextAccessor.TextMutator
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
TextAccessor.TextBuilder
public B withText(Collection<String> aText)
TextAccessor.TextBuilder
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- The text to be stored by the text property.public String toString()
String
being build by the builder upon the settings of the
attributes. The string array is returned as a single String
with
the operating system's end of line marker (CR on on Windows and CR LF on
*nix operating systems) as determined by
SystemUtility.getLineBreak()
toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text
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 © 2017. All rights reserved.