@Override public Iterator<CGNode> getSuccNodes(CGNode N) { ExplicitNode n = (ExplicitNode) N; return new IntMapIterator<>(n.getAllTargetNumbers().intIterator(), toNode); }
@Override public Iterator<CGNode> getSuccNodes(CGNode N) { ExplicitNode n = (ExplicitNode) N; return new IntMapIterator<>(n.getAllTargetNumbers().intIterator(), toNode); }
@Override public boolean isSubset(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return isSubset((MutableSharedBitVectorIntSet) that); } else { // really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { if (!that.contains(it.next())) { return false; } } return true; } }
@Override public boolean isSubset(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return isSubset((MutableSharedBitVectorIntSet) that); } else { // really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { if (!that.contains(it.next())) { return false; } } return true; } }
@Override public boolean isSubset(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return isSubset((MutableSharedBitVectorIntSet) that); } else { // really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { if (!that.contains(it.next())) { return false; } } return true; } }
@Override public void intersectWith(IntSet set) { if (set instanceof MutableSharedBitVectorIntSet) { intersectWithInternal((MutableSharedBitVectorIntSet) set); } else if (set instanceof BitVectorIntSet) { intersectWithInternal(new MutableSharedBitVectorIntSet((BitVectorIntSet) set)); } else { // this is really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (!set.contains(x)) { remove(x); } } } if (DEBUG) { if (privatePart != null && sharedPart != null) assert privatePart.intersection(sharedPart).isEmpty(); } }
@Override public void intersectWith(IntSet set) { if (set instanceof MutableSharedBitVectorIntSet) { intersectWithInternal((MutableSharedBitVectorIntSet) set); } else if (set instanceof BitVectorIntSet) { intersectWithInternal(new MutableSharedBitVectorIntSet((BitVectorIntSet) set)); } else { // this is really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (!set.contains(x)) { remove(x); } } } if (DEBUG) { if (privatePart != null && sharedPart != null) assert privatePart.intersection(sharedPart).isEmpty(); } }
@Override public void intersectWith(IntSet set) { if (set instanceof MutableSharedBitVectorIntSet) { intersectWithInternal((MutableSharedBitVectorIntSet) set); } else if (set instanceof BitVectorIntSet) { intersectWithInternal(new MutableSharedBitVectorIntSet((BitVectorIntSet) set)); } else { // this is really slow. optimize as needed. for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (!set.contains(x)) { remove(x); } } } if (DEBUG) { if (privatePart != null && sharedPart != null) assert privatePart.intersection(sharedPart).isEmpty(); } }
@Override public IntSet intersection(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return intersection((MutableSharedBitVectorIntSet) that); } else if (that instanceof BitVectorIntSet) { MutableSharedBitVectorIntSet m = new MutableSharedBitVectorIntSet((BitVectorIntSet) that); return intersection(m); } else if (that instanceof SparseIntSet) { BitVectorIntSet bv = new BitVectorIntSet(that); return intersection(bv); } else { // really slow. optimize as needed. BitVectorIntSet result = new BitVectorIntSet(); for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (that.contains(x)) { result.add(x); } } return result; } }
@Override public IntSet intersection(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return intersection((MutableSharedBitVectorIntSet) that); } else if (that instanceof BitVectorIntSet) { MutableSharedBitVectorIntSet m = new MutableSharedBitVectorIntSet((BitVectorIntSet) that); return intersection(m); } else if (that instanceof SparseIntSet) { BitVectorIntSet bv = new BitVectorIntSet(that); return intersection(bv); } else { // really slow. optimize as needed. BitVectorIntSet result = new BitVectorIntSet(); for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (that.contains(x)) { result.add(x); } } return result; } }
@Override public IntSet intersection(IntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (that instanceof MutableSharedBitVectorIntSet) { return intersection((MutableSharedBitVectorIntSet) that); } else if (that instanceof BitVectorIntSet) { MutableSharedBitVectorIntSet m = new MutableSharedBitVectorIntSet((BitVectorIntSet) that); return intersection(m); } else if (that instanceof SparseIntSet) { BitVectorIntSet bv = new BitVectorIntSet(that); return intersection(bv); } else { // really slow. optimize as needed. BitVectorIntSet result = new BitVectorIntSet(); for (IntIterator it = intIterator(); it.hasNext();) { int x = it.next(); if (that.contains(x)) { result.add(x); } } return result; } }