public class AlignTextUtility extends Object
Modifier and Type | Method and Description |
---|---|
static void |
doStrip(StringBuffer aStringBuffer,
char aChar)
Removes all leading and trailing chars identical with specified char ch.
|
static void |
doStripLeft(StringBuffer aStringBuffer,
char aChar)
Removes all leading chars identical with specified char ch.
|
static void |
doStripRight(StringBuffer aStringBuffer,
char aChar)
Removes all rear chars identical with specified char ch.
|
static String[] |
toAlign(String[] aText,
int aLength,
char aFillChar,
TextAlignMode aTextAlignMode) |
static String |
toAlign(String aText,
int aLength,
char aFillChar,
TextAlignMode aTextAlignMode)
Fills a text up on by appending the given char to the left and the right
till the given length is reached.
|
static String[] |
toAlignBlock(String[] aText,
int aLength,
char aFillChar) |
static String |
toAlignBlock(String aText,
int aLength,
char aFillChar)
Fills a text up on by adding the given char to occurrences of the given
char round robin till given length is reached (block mode).
|
static String[] |
toAlignCenter(String[] aText,
int aLength,
char aFillChar) |
static String |
toAlignCenter(String aText,
int aLength,
char aFillChar)
Fills a text up on by appending the given char to the left and the right
till the given length is reached (align center).
|
static String[] |
toAlignLeft(String[] aText,
int aLength,
char aFillChar) |
static String |
toAlignLeft(String aText,
int aLength,
char aFillChar)
Fills a text up on by appending the given char to the right till the
given length is reached (align left).
|
static String[] |
toAlignRight(String[] aText,
int aLength,
char aFillChar) |
static String |
toAlignRight(String aText,
int aLength,
char aFillChar)
Fills a text up by prepending the given char to the left till the given
length is reached (align right).
|
static String |
toOverwriteLeft(String aText,
String aWriteOverText)
Overwrites a text starting at the left hand side with the given
"overwriting" text.
|
static String |
toOverwriteRight(String aText,
String aWriteOverText)
Overwrites a text starting at the right hand side with the given
"overwriting" text.
|
static String |
toStrip(String aText,
char[] aChars)
Returns a new String without leading nor trailing chars.
|
static String |
toStripLeft(String aText,
char[] aChars)
Returns a new String without leading chars.
|
static String |
toStripRight(String aText,
char[] aChars)
Returns a new String without trailing chars.
|
public static String toAlign(String aText, int aLength, char aFillChar, TextAlignMode aTextAlignMode)
aText
- The text to be filled up or aligned.aLength
- The length to be reached.aFillChar
- The char to be used for filling upString
filled up with the given char till the width is
reached or the String
untouched in case no
TextAlignMode
parameter has been provided..public static String[] toAlign(String[] aText, int aLength, char aFillChar, TextAlignMode aTextAlignMode)
except applied to
{@link String} arrays.
public static String toAlignLeft(String aText, int aLength, char aFillChar)
aText
- The text to be filled up.aLength
- The length to be reached.aFillChar
- The char to be used for filling upString
filled up on the right hand side with the given
char.public static String[] toAlignLeft(String[] aText, int aLength, char aFillChar)
except applied to {@link String}
arrays.
public static String toAlignRight(String aText, int aLength, char aFillChar)
aText
- The text to be filled up.aLength
- The length to be reached.aFillChar
- The char to be used for filling upString
filled up on the left hand side with the given
char.public static String[] toAlignRight(String[] aText, int aLength, char aFillChar)
except applied to {@link String}
arrays.
public static String toAlignCenter(String aText, int aLength, char aFillChar)
aText
- The text to be filled up.aLength
- The length to be reached.aFillChar
- The char to be used for filling upString
filled up on the left and right hand side with
the given char.public static String[] toAlignCenter(String[] aText, int aLength, char aFillChar)
except applied to {@link String}
arrays.
public static String toAlignBlock(String aText, int aLength, char aFillChar)
aText
- The text to be filled up.aLength
- The length to be reached.aFillChar
- The char to be used for filling upString
filled up in block mode with the given char.public static String[] toAlignBlock(String[] aText, int aLength, char aFillChar)
except applied to {@link String}
arrays.
public static String toOverwriteLeft(String aText, String aWriteOverText)
aText
- The text to be overwritten.aWriteOverText
- The text used for overwriting.String
overwritten on the left hand side with the given
"overwriting" text.public static String toOverwriteRight(String aText, String aWriteOverText)
aText
- The text to be overwritten.aWriteOverText
- The text used for overwriting.String
overwritten on the right hand side with the
given "overwriting" text.public static void doStripLeft(StringBuffer aStringBuffer, char aChar)
String
will be BBBAAABBB.aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.public static String toStripLeft(String aText, char[] aChars)
aText
- The text to be stripped.public static void doStripRight(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.public static void doStrip(StringBuffer aStringBuffer, char aChar)
aStringBuffer
- StringBuffer to modify.aChar
- Char to remove.public static String toStripRight(String aText, char[] aChars)
aText
- Description is currently not available!Copyright © 2015. All rights reserved.