List of utility methods to do Set Search
boolean | contains(BitSet x, BitSet y) Returns true if all bits set in the second parameter are also set in the first BitSet tmp = new BitSet(); tmp.or(y); tmp.andNot(x); return tmp.isEmpty(); |
boolean | Contains(Set s, Object o) Contains if (!s.contains(o)) { if (o instanceof Number) { double val = ((Number) o).doubleValue(); for (Iterator it = s.iterator(); it.hasNext();) { Object e = it.next(); if (e instanceof Number) if (val == ((Number) e).doubleValue()) return true; ... |
boolean | contains(Set contains for (String s : mustHaveAllThese) { if (!setTocheck.contains(s)) { return false; return true; |
boolean | containsAny(Set contains Any boolean result = false; Iterator<T> possibilitiesIter = possibilities.iterator(); while (!result && possibilitiesIter.hasNext()) { result = container.contains(possibilitiesIter.next()); return result; |
boolean | containsCaseInsensitive(String s, Set contains Case Insensitive for (String string : l) { if (string.equalsIgnoreCase(s)) { return true; return false; |
boolean | containsSome(Set one, Set two) Test if one set has overlapping membership with another set Iterator it = two.iterator(); while (it.hasNext()) { if (one.contains(it.next())) { return true; return false; |