List of utility methods to do Collection Subset
boolean | isSubset(Collection> subset, Collection> of) is Subset for (Object obj : subset) { if (!of.contains(obj)) { return false; return true; |
boolean | isSubset(Collection Verify if a set is subset of other set int occurrenceCount = 0; if (subSet != null && superSet != null) { for (E subSetElement : subSet) { if (superSet.contains(subSetElement)) { occurrenceCount++; if (occurrenceCount == subSet.size()) { ... |
boolean | isSubset(Collection is Subset for (T t : s2) { if (!s1.contains(t)) return false; return true; |
boolean | isSubset(Collection is Subset if ((superset == null) || (superset.size() == 0)) { return ((subset == null) || (subset.size() == 0)); HashSet<T> hash = new HashSet<T>(superset); for (T t : subset) { if (!hash.contains(t)) { return false; return true; |
boolean | isSubset(final Collection Checks whether the first collection provided is a subset of the second collection provided. return l2.containsAll(l1);
|
List | sub(Collection sub if (list == null || list.isEmpty()) { return null; return sub(new ArrayList<T>(list), start, end); |