if (this.equals(that)) return true; if (this.sameValue(that)) { return true;
@Override public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { throw new IllegalArgumentException("that == null"); } if (that instanceof SparseIntSet) { return sameValueInternal((SparseIntSet) that); } else if (that instanceof BimodalMutableIntSet) { return that.sameValue(this); } else if (that instanceof BitVectorIntSet) { return that.sameValue(this); } else if (that instanceof MutableSharedBitVectorIntSet) { return sameValue(((MutableSharedBitVectorIntSet) that).makeSparseCopy()); } else { Assertions.UNREACHABLE(that.getClass().toString()); return false; } }
if (this.equals(that)) return true; if (this.sameValue(that)) { return true;
@Override public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { throw new IllegalArgumentException("that == null"); } if (that instanceof SparseIntSet) { return sameValueInternal((SparseIntSet) that); } else if (that instanceof BimodalMutableIntSet) { return that.sameValue(this); } else if (that instanceof BitVectorIntSet) { return that.sameValue(this); } else if (that instanceof MutableSharedBitVectorIntSet) { return sameValue(((MutableSharedBitVectorIntSet) that).makeSparseCopy()); } else { Assertions.UNREACHABLE(that.getClass().toString()); return false; } }
if (this.equals(that)) return true; if (this.sameValue(that)) { return true;
@Override public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError { if (that == null) { throw new IllegalArgumentException("that == null"); } if (that instanceof SparseIntSet) { return sameValueInternal((SparseIntSet) that); } else if (that instanceof BimodalMutableIntSet) { return that.sameValue(this); } else if (that instanceof BitVectorIntSet) { return that.sameValue(this); } else if (that instanceof MutableSharedBitVectorIntSet) { return sameValue(((MutableSharedBitVectorIntSet) that).makeSparseCopy()); } else { Assertions.UNREACHABLE(that.getClass().toString()); return false; } }
} else if (A.equals(B)) { return new int[0]; } else if (A.sameValue(B)) { return new int[0];
} else if (A.equals(B)) { return new int[0]; } else if (A.sameValue(B)) { return new int[0];
} else if (A.equals(B)) { return new int[0]; } else if (A.sameValue(B)) { return new int[0];
private boolean sameValue(BitVectorIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else // shared part is null and size is same, so number of bits is low return that.makeSparseCopy().sameValue(privatePart); } else { if (privatePart == null) return sharedPart.sameValue(that); else /* sharedPart != null */ return makeDenseCopy().sameValue(that); } }
private boolean sameValue(BitVectorIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else // shared part is null and size is same, so number of bits is low return that.makeSparseCopy().sameValue(privatePart); } else { if (privatePart == null) return sharedPart.sameValue(that); else /* sharedPart != null */ return makeDenseCopy().sameValue(that); } }
private boolean sameValue(BitVectorIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else // shared part is null and size is same, so number of bits is low return that.makeSparseCopy().sameValue(privatePart); } else { if (privatePart == null) return sharedPart.sameValue(that); else /* sharedPart != null */ return makeDenseCopy().sameValue(that); } }