List of utility methods to do List Create
List | createUniqueProducts(List Appends the newly fetched recommendation resources (that are not already contained) to the end of the list List<String> uniqueList = new ArrayList<String>(); if (list1 != null) { for (String recommendedProduct : list1) { if (!uniqueList.contains(recommendedProduct)) { uniqueList.add(recommendedProduct); if (list2 != null) { for (String recommendedProduct : list2) { if (!uniqueList.contains(recommendedProduct)) { uniqueList.add(recommendedProduct); return uniqueList; |
List | createUnmodifiableList(Collection create Unmodifiable List List<T> aList; if (coll == null || coll.size() == 0) aList = Collections.emptyList(); else { List<T> newList; if (coll.size() == 1) { T value = (coll instanceof List<?>) ? ((List<T>) coll).get(0) : coll.iterator().next(); newList = Collections.singletonList(value); ... |
String | createUpdateMeasurementItemList(final String itemList, final String updateItem) Create the updated measurement ItemList depend on operation String updateList = null; List<String> list = new ArrayList<String>(Arrays.asList(itemList.split(","))); if (list.indexOf(updateItem) == -1) { return itemList; list.remove(list.indexOf(updateItem)); if (list.size() > 0) { updateList = list.get(0); ... |
List | createValues(int barCount, String valueDigits, int distributionType, List create Values int digitCount = valueDigits.length(); assert (barCount <= (digitCount * digitCount)); List<String> values = new ArrayList<String>(barCount); int iterations = barCount / digitCount; int residual = barCount % digitCount; for (int i = 0; i < digitCount; i++) { int currentIterations = iterations; if (i < residual) { ... |
String | createWhereInClause(String field, List create Where In Clause if (field == null || field.isEmpty() || values == null || values.isEmpty()) { return ""; StringBuilder stringBuilder = new StringBuilder(field).append(" IN ("); int index = 0; String separator; if (isString) { separator = "', '"; ... |
List
| createWidList(int[][] widArray) Converts two dimensional integer (representing word ids) array into a list of lists. List<List<Integer>> widList = new ArrayList<List<Integer>>(); for (int[] widArrayGroup : widArray) { List<Integer> widListGroup = new ArrayList<Integer>(); for (int wid : widArrayGroup) { widListGroup.add(wid); widList.add(widListGroup); return widList; |
List | getOrCreateList(Map get Or Create List List<T> set = map.get(key); if (set == null) { set = new ArrayList<T>(); map.put(key, set); return set; |