/** * Finds out if this set is a subset of the given set. * * @param otherSet The other set. * @return <code>true</code> if all elements in this set are also present in the other set, <code>false</code> otherwise. */ public synchronized boolean isSubsetOfSet(NSSet otherSet) { for (NSObject o : this.set) { if (!otherSet.containsObject(o)) return false; } return true; }
/** * Finds out whether at least one object is present in both sets. * * @param otherSet The other set. * @return <code>false</code> if the intersection of both sets is empty, <code>true</code> otherwise. */ public synchronized boolean intersectsSet(NSSet otherSet) { for (NSObject o : this.set) { if (otherSet.containsObject(o)) return true; } return false; }