@Override public EquatableValueSet intersect(ValueSet other) { EquatableValueSet otherValueSet = checkCompatibility(other); if (whiteList && otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, intersect(entries, otherValueSet.entries)); } else if (whiteList) { return new EquatableValueSet(type, true, subtract(entries, otherValueSet.entries)); } else if (otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, subtract(otherValueSet.entries, entries)); } else { return new EquatableValueSet(type, false, union(otherValueSet.entries, entries)); } }
@Override public EquatableValueSet union(ValueSet other) { EquatableValueSet otherValueSet = checkCompatibility(other); if (whiteList && otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, union(entries, otherValueSet.entries)); } else if (whiteList) { return new EquatableValueSet(type, false, subtract(otherValueSet.entries, entries)); } else if (otherValueSet.isWhiteList()) { return new EquatableValueSet(type, false, subtract(entries, otherValueSet.entries)); } else { return new EquatableValueSet(type, false, intersect(otherValueSet.entries, entries)); } }
@Override public EquatableValueSet intersect(ValueSet other) { EquatableValueSet otherValueSet = checkCompatibility(other); if (whiteList && otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, intersect(entries, otherValueSet.entries)); } else if (whiteList) { return new EquatableValueSet(type, true, subtract(entries, otherValueSet.entries)); } else if (otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, subtract(otherValueSet.entries, entries)); } else { return new EquatableValueSet(type, false, union(otherValueSet.entries, entries)); } }
@Override public EquatableValueSet union(ValueSet other) { EquatableValueSet otherValueSet = checkCompatibility(other); if (whiteList && otherValueSet.isWhiteList()) { return new EquatableValueSet(type, true, union(entries, otherValueSet.entries)); } else if (whiteList) { return new EquatableValueSet(type, false, subtract(otherValueSet.entries, entries)); } else if (otherValueSet.isWhiteList()) { return new EquatableValueSet(type, false, subtract(entries, otherValueSet.entries)); } else { return new EquatableValueSet(type, false, intersect(otherValueSet.entries, entries)); } }