List of utility methods to do List Create
String | createMultiParamMessage(String aPrefix, String aSuffix, List extends Object> aParams) create Multi Param Message StringBuilder tLogTextBuilder = new StringBuilder(); tLogTextBuilder.append(aPrefix); for (Object tCurrentParam : aParams) { tLogTextBuilder.append("\""); tLogTextBuilder.append(tCurrentParam.toString()); tLogTextBuilder.append("\" "); tLogTextBuilder.append(aSuffix); ... |
String | createMultiSelectionValue(List create Multi Selection Value Collections.sort(values); StringBuilder sb = new StringBuilder(); for (int i = 0; i < values.size(); i++) { if (i > 0) { sb.append(' '); sb.append("\"" + values.get(i) + "\""); return sb.toString(); |
List | createMutableList(Collection create Mutable List List<E> mutableList = new ArrayList<>(); if (isNotEmpty(collection)) { for (E data : collection) { mutableList.add(data); return mutableList; |
List | createNewList(Class type) create New List if (type == List.class) { return new ArrayList(); } else if (type.isInterface()) { throw new RuntimeException("Can't instantiate a list type: " + type); try { return (List) type.newInstance(); } catch (Exception e) { ... |
void | createNormalDistributionByBootstrapping(List extends Number> values1, List extends Number> values2, final List Creates normal distribution by bootstrapping the given samples. if (values1.size() < 3 * NUM_ITEMS_IN_SUM || values2.size() < 3 * NUM_ITEMS_IN_SUM) { throw new RuntimeException( "Cannot conduct t-test on non normally distributed sample sets. Not enough data points!"); double sum = 0; int counter = 0; for (Number num : values1) { if (counter % NUM_ITEMS_IN_SUM == 0 && counter != 0) { ... |
List | createNormativeTroopAllocation(List Creates a troop allocation where 100% of troops are allocated against the group or location with the highest probability. if (probs != null && !probs.isEmpty()) { ArrayList<Integer> I = new ArrayList<Integer>(probs.size()); int maxProb = Integer.MIN_VALUE; int maxProbIndex = 0; int i = 0; for (Integer prob : probs) { if (prob > maxProb) { maxProb = prob; ... |
List | createNullElementList(int size) create Null Element List List lst = new ArrayList(size); for (int i = lst.size(); i < size; i++) { lst.add(null); return lst; |
List | createNullList(int numberOfElements) Create a List of the specified size filled with null, in order to be able to use set() to set elements in arbitrary order. List<T> list = new ArrayList<T>(numberOfElements); for (int j = 0; j < numberOfElements; j++) { list.add(null); return list; |
ArrayList | CreateObjectList(Object... values) Creates a list of objects from an array of objects. ArrayList results = new ArrayList(); Collections.addAll(results, values); return results; |
List | createOneElementList(T element) creates an array list with the one given element. List<T> list = new ArrayList<T>(); list.add(element); return list; |