/** {@inheritDoc} */ @Override public IntervalSet complement(IntSet vocabulary) { if ( vocabulary==null || vocabulary.isNil() ) { return null; // nothing in common with null set } IntervalSet vocabularyIS; if (vocabulary instanceof IntervalSet) { vocabularyIS = (IntervalSet)vocabulary; } else { vocabularyIS = new IntervalSet(); vocabularyIS.addAll(vocabulary); } return vocabularyIS.subtract(this); }
@Override public IntervalSet addAll(IntSet set) { if ( set==null ) { return this; } if (set instanceof IntervalSet) { IntervalSet other = (IntervalSet)set; // walk set and add each interval int n = other.intervals.size(); for (int i = 0; i < n; i++) { Interval I = other.intervals.get(i); this.add(I.a,I.b); } } else { for (int value : set.toList()) { add(value); } } return this; }
@Override public IntervalSet subtract(IntSet a) { if (a == null || a.isNil()) { return new IntervalSet(this); } if (a instanceof IntervalSet) { return subtract(this, (IntervalSet)a); } IntervalSet other = new IntervalSet(); other.addAll(a); return subtract(this, other); }
@Override public IntervalSet addAll(IntSet set) { if ( set==null ) { return this; } if (set instanceof IntervalSet) { IntervalSet other = (IntervalSet)set; // walk set and add each interval int n = other.intervals.size(); for (int i = 0; i < n; i++) { Interval I = other.intervals.get(i); this.add(I.a,I.b); } } else { for (int value : set.toList()) { add(value); } } return this; }
/** {@inheritDoc} */ @Override public IntervalSet complement(IntSet vocabulary) { if ( vocabulary==null || vocabulary.isNil() ) { return null; // nothing in common with null set } IntervalSet vocabularyIS; if (vocabulary instanceof IntervalSet) { vocabularyIS = (IntervalSet)vocabulary; } else { vocabularyIS = new IntervalSet(); vocabularyIS.addAll(vocabulary); } return vocabularyIS.subtract(this); }
@Override public IntervalSet addAll(IntSet set) { if ( set==null ) { return this; } if (set instanceof IntervalSet) { IntervalSet other = (IntervalSet)set; // walk set and add each interval int n = other.intervals.size(); for (int i = 0; i < n; i++) { Interval I = other.intervals.get(i); this.add(I.a,I.b); } } else { for (int value : set.toList()) { add(value); } } return this; }
/** {@inheritDoc} */ @Override public IntervalSet complement(IntSet vocabulary) { if ( vocabulary==null || vocabulary.isNil() ) { return null; // nothing in common with null set } IntervalSet vocabularyIS; if (vocabulary instanceof IntervalSet) { vocabularyIS = (IntervalSet)vocabulary; } else { vocabularyIS = new IntervalSet(); vocabularyIS.addAll(vocabulary); } return vocabularyIS.subtract(this); }
@Override public IntervalSet addAll(IntSet set) { if ( set==null ) { return this; } if (set instanceof IntervalSet) { IntervalSet other = (IntervalSet)set; // walk set and add each interval int n = other.intervals.size(); for (int i = 0; i < n; i++) { Interval I = other.intervals.get(i); this.add(I.a,I.b); } } else { for (int value : set.toList()) { add(value); } } return this; }
/** {@inheritDoc} */ @Override public IntervalSet complement(IntSet vocabulary) { if ( vocabulary==null || vocabulary.isNil() ) { return null; // nothing in common with null set } IntervalSet vocabularyIS; if (vocabulary instanceof IntervalSet) { vocabularyIS = (IntervalSet)vocabulary; } else { vocabularyIS = new IntervalSet(); vocabularyIS.addAll(vocabulary); } return vocabularyIS.subtract(this); }
@Override public IntervalSet addAll(IntSet set) { if ( set==null ) { return this; } if (set instanceof IntervalSet) { IntervalSet other = (IntervalSet)set; // walk set and add each interval int n = other.intervals.size(); for (int i = 0; i < n; i++) { Interval I = other.intervals.get(i); this.add(I.a,I.b); } } else { for (int value : set.toList()) { add(value); } } return this; }
/** {@inheritDoc} */ @Override public IntervalSet complement(IntSet vocabulary) { if ( vocabulary==null || vocabulary.isNil() ) { return null; // nothing in common with null set } IntervalSet vocabularyIS; if (vocabulary instanceof IntervalSet) { vocabularyIS = (IntervalSet)vocabulary; } else { vocabularyIS = new IntervalSet(); vocabularyIS.addAll(vocabulary); } return vocabularyIS.subtract(this); }
@Override public IntervalSet subtract(IntSet a) { if (a == null || a.isNil()) { return new IntervalSet(this); } if (a instanceof IntervalSet) { return subtract(this, (IntervalSet)a); } IntervalSet other = new IntervalSet(); other.addAll(a); return subtract(this, other); }
@Override public IntervalSet subtract(IntSet a) { if (a == null || a.isNil()) { return new IntervalSet(this); } if (a instanceof IntervalSet) { return subtract(this, (IntervalSet)a); } IntervalSet other = new IntervalSet(); other.addAll(a); return subtract(this, other); }
@Override public IntervalSet subtract(IntSet a) { if (a == null || a.isNil()) { return new IntervalSet(this); } if (a instanceof IntervalSet) { return subtract(this, (IntervalSet)a); } IntervalSet other = new IntervalSet(); other.addAll(a); return subtract(this, other); }
@Override public IntervalSet subtract(IntSet a) { if (a == null || a.isNil()) { return new IntervalSet(this); } if (a instanceof IntervalSet) { return subtract(this, (IntervalSet)a); } IntervalSet other = new IntervalSet(); other.addAll(a); return subtract(this, other); }