/** Compute this-other via this&~other. * Return a new set containing all elements in this but not in other. * other is assumed to be a subset of this; * anything that is in other but not in this will be ignored. */ @Override public IntervalSet subtract(IntSet other) { // assume the whole unicode range here for the complement // because it doesn't matter. Anything beyond the max of this' set // will be ignored since we are doing this & ~other. The intersection // will be empty. The only problem would be when this' set max value // goes beyond MAX_CHAR_VALUE, but hopefully the constant MAX_CHAR_VALUE // will prevent this. return this.and(((IntervalSet)other).complement(COMPLETE_SET)); }
/** Compute this-other via this&~other. * Return a new set containing all elements in this but not in other. * other is assumed to be a subset of this; * anything that is in other but not in this will be ignored. */ @Override public IntervalSet subtract(IntSet other) { // assume the whole unicode range here for the complement // because it doesn't matter. Anything beyond the max of this' set // will be ignored since we are doing this & ~other. The intersection // will be empty. The only problem would be when this' set max value // goes beyond MAX_CHAR_VALUE, but hopefully the constant MAX_CHAR_VALUE // will prevent this. return this.and(((IntervalSet)other).complement(COMPLETE_SET)); }
/** Compute this-other via this&~other. * Return a new set containing all elements in this but not in other. * other is assumed to be a subset of this; * anything that is in other but not in this will be ignored. */ public IntSet subtract(IntSet other) { // assume the whole unicode range here for the complement // because it doesn't matter. Anything beyond the max of this' set // will be ignored since we are doing this & ~other. The intersection // will be empty. The only problem would be when this' set max value // goes beyond MAX_CHAR_VALUE, but hopefully the constant MAX_CHAR_VALUE // will prevent this. return this.and(((IntervalSet)other).complement(COMPLETE_SET)); }
public IntSet complement(int minElement, int maxElement) { return this.complement(IntervalSet.of(minElement,maxElement)); }
public IntervalSet complement(int minElement, int maxElement) { return this.complement(IntervalSet.of(minElement,maxElement)); }
public IntervalSet complement(int minElement, int maxElement) { return this.complement(IntervalSet.of(minElement,maxElement)); }
public IntSet complement(int minElement, int maxElement) { return this.complement(IntervalSet.of(minElement,maxElement)); }
/** Compute this-other via this&~other. * Return a new set containing all elements in this but not in other. * other is assumed to be a subset of this; * anything that is in other but not in this will be ignored. */ public IntSet subtract(IntSet other) { // assume the whole unicode range here for the complement // because it doesn't matter. Anything beyond the max of this' set // will be ignored since we are doing this & ~other. The intersection // will be empty. The only problem would be when this' set max value // goes beyond MAX_CHAR_VALUE, but hopefully the constant MAX_CHAR_VALUE // will prevent this. return this.and(((IntervalSet)other).complement(COMPLETE_SET)); }