List of utility methods to do List from Array
List | asList(Object value) as List if (value == null) { return Collections.EMPTY_LIST; } else if (value instanceof List) { return (List) value; } else if (value.getClass().isArray()) { return Arrays.asList((Object[]) value); } else if (value instanceof Enumeration) { List answer = new ArrayList(); ... |
List | asList(Object[] array) Subtitution for Arrays.asList. ArrayList list = new ArrayList(); appendArrayToList(array, list); return list; |
List | asList(Object[] array) as List @SuppressWarnings("unchecked") List<T> list = (List<T>) Arrays.asList(array); return list; |
List | asList(Set as List return (List<V>) Arrays.asList(set.toArray());
|
List | asList(String data) Convert an String to List return asList(data.getBytes());
|
List | asList(String str) take a string of ints (eg: 1,2,3,4), and return a List of Integers return asList(str, ","); |
List | asList(String string) as List if (string == null || "".equals(string)) return new ArrayList(); String tokens[] = string.split(","); ArrayList list = new ArrayList(); String arr$[] = tokens; int len$ = arr$.length; for (int i$ = 0; i$ < len$; i$++) { String t = arr$[i$]; ... |
List | asList(String strList, String regex) as List List<String> list = new ArrayList<String>(); if (null == strList || strList.isEmpty()) { return null; } else { String[] strLists = strList.split(regex); for (String str : strLists) { list.add(str); return list; |
Collection | asList(String val) as List return asList(val, "\\s*,\\s*"); |
ArrayList | asList(String valuesSeparatedBy, String delimiter) as List ArrayList<String> retVal = new ArrayList<String>(); String[] pieces = valuesSeparatedBy.split(delimiter); for (String piece : pieces) { retVal.add(piece.trim()); return retVal; |