@Override public boolean containsAny(IntSet set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (set instanceof BitVectorIntSet) { BitVectorIntSet b = (BitVectorIntSet) set; return !bitVector.intersectionEmpty(b.bitVector); } else { // TODO: optimize for (IntIterator it = set.intIterator(); it.hasNext();) { if (contains(it.next())) { return true; } } return false; } }
@Override public boolean containsAny(IntSet set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (set instanceof BitVectorIntSet) { BitVectorIntSet b = (BitVectorIntSet) set; return !bitVector.intersectionEmpty(b.bitVector); } else { // TODO: optimize for (IntIterator it = set.intIterator(); it.hasNext();) { if (contains(it.next())) { return true; } } return false; } }
@Override public boolean containsAny(IntSet set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (set instanceof BitVectorIntSet) { BitVectorIntSet b = (BitVectorIntSet) set; return !bitVector.intersectionEmpty(b.bitVector); } else { // TODO: optimize for (IntIterator it = set.intIterator(); it.hasNext();) { if (contains(it.next())) { return true; } } return false; } }