List of utility methods to do Collection Subtract
Collection | sub(Collection sub Set<T> result = new HashSet<T>(); for (T t : s) if (t != item) result.add(t); return result; |
Collection | subCollection(Collection sub Collection if (!isNullOrEmpty(col) && (col.size() > amount)) { ArrayList<T> list = new ArrayList<T>(col); return list.subList(0, amount); return col; |
Collection | subCollection(final Collection sub Collection if (collection == null || collection.isEmpty()) { return collection; int start = offset; if (start > collection.size()) { start = collection.size(); int end = start + limit; ... |
Map | subMap(Map sub Map Map<K, V> subMap = new HashMap<K, V>(keys.size()); for (K key : keys) { V value = map.get(key); if (value != null) { subMap.put(key, value); return subMap; ... |
Map | substractBackground( final Map substract Background final double ZERO = 0.0; final Map<Double, Collection<double[]>> concentrationToSubtractedReadings = new TreeMap<>(); for (Iterator<Map.Entry<Double, Collection<double[]>>> iterator = concentrationToSampleReadings.entrySet() .iterator(); iterator.hasNext();) { final Map.Entry<Double, Collection<double[]>> entry = iterator.next(); final Double concentration = entry.getKey(); final Collection<double[]> sampleReadings = entry.getValue(); final Collection<double[]> backgroundReadings = concentrationToBackgroundReadings.get(concentration); ... |
Collection | subtract(Collection a, Collection b) subtract Collection results = new HashSet(); for (Iterator i = a.iterator(); i.hasNext();) { Object o = i.next(); if (!(b.contains(o))) { results.add(o); return results; ... |
Collection | subtract(Collection c1, Collection c2) subtract if (isEmpty(c1) || isEmpty(c2)) return c1; List list = newArrayList(c1); Iterator iterator = c2.iterator(); Object element; while (iterator.hasNext()) { element = iterator.next(); if (c2.contains(element)) ... |
List | subtract(Collection subtract Set<Integer> y = new HashSet<Integer>(b); Set<Integer> z = new HashSet<Integer>(); for (Integer i : a) { if (y.add(i)) z.add(i); return new ArrayList(z); |
List | subtract(Collection c1 - c2, does not change input collections, returns new collection (list) if (c1 == null) { return Collections.emptyList(); List<T> tmp = new ArrayList<>(c1); if (c2 != null) { tmp.removeAll(c2); return tmp; ... |
List | subtract(Collection Returns all elements that are in l1 but not in l2 as a list. List<T> newList = new ArrayList<T>(l1); newList.removeAll(l2); return newList; |