|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jpop.util.ArrayUtils
Collection of static methods to manipulate arrays and lists
Constructor Summary | |
ArrayUtils()
|
Method Summary | |
static java.lang.String |
lineArrayToString(java.lang.String[] sa)
parses a String array to form a String of all its items, one per line |
static java.lang.String |
objectArrayToString(java.lang.Object[] sa)
parses an Object array to form a String of all its items, one per line |
static int |
present(java.lang.Object[] arr,
java.lang.Object item)
Checks if an item is present in an array |
static int |
presentIgnoreCase(java.lang.String[] arr,
java.lang.String item)
Checks if a String is present in an array of Strings |
static void |
qsort(java.util.List list)
Sorts a String list using the quicksort algorithm |
static java.lang.Object[] |
stringToLineArray(java.lang.String s)
parses a String to form an array of all its lines |
static java.util.LinkedList |
stringToListOfWords(java.lang.String s)
Make a nested list of lines/words out of a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayUtils()
Method Detail |
public static void qsort(java.util.List list) throws java.lang.ClassCastException
list
- The string list to sort
java.lang.ClassCastException
- If its not possible to cast the object to a stringpublic static int present(java.lang.Object[] arr, java.lang.Object item)
arr
- the arrayitem
- the item
public static int presentIgnoreCase(java.lang.String[] arr, java.lang.String item)
arr
- the arrayitem
- the item
public static java.lang.Object[] stringToLineArray(java.lang.String s)
s
- The string to convert
public static java.util.LinkedList stringToListOfWords(java.lang.String s)
line one line two line threeis provided as input, then the output would be:
[ ["line", "one"], ["line", "two"], ["line", "three"] ]
s
- The string to convert
public static java.lang.String lineArrayToString(java.lang.String[] sa)
sa
- The array to make into a string
public static java.lang.String objectArrayToString(java.lang.Object[] sa)
sa
- The array to make into a string
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |