public abstract class ArrayTransformations extends Object
| Constructor and Description |
|---|
ArrayTransformations() |
| Modifier and Type | Method and Description |
|---|---|
static <T> StrBuilder |
ARRAY_TO_STRING(T[][] ar)
Takes a 2 dimensional array and returns a string representation in table form.
|
static String[][] |
FLIP_ARRAY(String[][] ar)
Flips an array of arrays (a table).
|
static String[][] |
NORMALISE_ARRAY(int length,
String[][] ar)
Normalizes an array of strings.
|
static String[] |
PROCESS_CONTENT(Object content)
Takes an object (used as a string) and returns a string array with all processed lines.
|
static String[] |
WRAP_LINES(int length,
Object obj)
Takes an object (used as a string) and returns a string array with wrapped lines of max length.
|
static String[] |
WRAP_LINES(int length,
String[] ar)
Takes an content array (of strings) and returns a string array with wrapped lines of max length using
WRAP_LINES(int, Object). |
public static final <T> StrBuilder ARRAY_TO_STRING(T[][] ar)
T - type of the input arrayar - the array to be transformedpublic static final String[][] FLIP_ARRAY(String[][] ar)
row 1: a1, b1, c1 row 2: a2, b2, c2 row 3: a3, b3, c3The transformed table will be
row 1: a1, a2, a3 row 2: b1, b2, b3 row 3: c1, c2, c3
ar - input array which will be flippedpublic static final String[][] NORMALISE_ARRAY(int length, String[][] ar)
length - number of columns in the transformed string arrayar - input array which will be normalizedpublic static final String[] PROCESS_CONTENT(Object content)
String: "paragraph 1\nparagraph 2"
Array: {paragraph 1,paragraph 2}
A string containing 2 line breaks will be converted into 3 strings (first paragraph, additional line break, second paragraph):
String: "paragraph 1\n\nparagraph 2"
Array: {paragraph 1,,paragraph 2}
content - the content to processpublic static final String[] WRAP_LINES(int length, String[] ar)
WRAP_LINES(int, Object).
The wrapping is done using StringUtils and WordUtils so that words are not broken into characters.length - max length of a string in the returned arrayar - array with one line per array entry, null and empty objects are allowedpublic static final String[] WRAP_LINES(int length, Object obj)
length - max length of a string in the returned arrayobj - input object, null and empty objects are allowedCopyright © 2010–2015. All rights reserved.