List of utility methods to do List Create
List | asList(T... a) as List if (a == null || a.length == 0) { return new ArrayList<T>(); return Arrays.asList(a); |
List | asList(T... array) as List if (array == null) { return null; List<T> list = new ArrayList<T>(array.length); for (T t : array) { list.add(t); return list; ... |
List | asList(T... elements) as List List<T> toReturn = new ArrayList<>(); toReturn.addAll(Arrays.asList(elements)); return toReturn; |
List | asList(T... items) as List return Arrays.asList(items);
|
List | asList(T... objs) Return list literals as list and return array as list; also handle null array. return objs != null ? Arrays.asList(objs) : new ArrayList<T>(); |
List | asList(T[] array) as List List<T> list = new ArrayList<>(); for (T value : array) { list.add(value); return list; |
List | asListBox(double[] a) as List Box List<Double> list = new ArrayList<Double>(); for (int i = 0; i < a.length; i++) list.add(a[i]); return list; |
List | asListNoNulls(T... array) as List No Nulls ArrayList<T> result = new ArrayList<T>(); for (T t : array) { if (t != null) { result.add(t); return result; |
List
| create2DHorizontalIndexList(final int n) create D Horizontal Index List List<List<Integer>> result = new ArrayList<List<Integer>>(); result.add(new ArrayList<Integer>()); for (int i = 0; i < n; i++) { result.get(0).add(i); return result; |
ArrayList | createActMask(ArrayList create Act Mask ArrayList<Double> mask = new ArrayList<>(beliefActions.size()); for (int i = 0; i < beliefActions.size(); i++) { mask.add(0.0); int[] action = beliefActions.get(i); for (int[] act : stateActions) { if (Arrays.equals(act, action)) { mask.set(i, 1.0); break; ... |