public boolean isEmpty() { if (subsets == null) return true; for (Iterator subsetIt = subsets.iterator(); subsetIt.hasNext(); ) { final PointsToSet subset = (PointsToSet) subsetIt.next(); if (!subset.isEmpty()) return false; } return true; }
public Set possibleTypes() { if (subsets == null) { return Collections.EMPTY_SET; } HashSet ret = new HashSet(); for (Iterator subsetIt = subsets.iterator(); subsetIt.hasNext(); ) { final PointsToSet subset = (PointsToSet) subsetIt.next(); ret.addAll(subset.possibleTypes()); } return ret; }
public boolean hasNonEmptyIntersection(PointsToSet other) { if (subsets == null) return true; for (Iterator subsetIt = subsets.iterator(); subsetIt.hasNext(); ) { final PointsToSet subset = (PointsToSet) subsetIt.next(); if (other instanceof Union) { if (other.hasNonEmptyIntersection(subset)) return true; } else { if (subset.hasNonEmptyIntersection(other)) return true; } } return false; }