/** return this | a in a new set */ @Override public IntSet or(IntSet a) { if ( a==null ) { return this; } BitSet s = (BitSet)this.clone(); s.orInPlace((BitSet)a); return s; }
@Override public void addAll(IntSet set) { if ( set instanceof BitSet ) { this.orInPlace((BitSet)set); } else if ( set instanceof IntervalSet ) { IntervalSet other = (IntervalSet)set; // walk set and add each interval for (Interval I : other.intervals) { this.orInPlace(BitSet.range(I.a,I.b)); } } else { throw new IllegalArgumentException("can't add "+ set.getClass().getName()+ " to BitSet"); } }
/** return this | a in a new set */ @Override public IntSet or(IntSet a) { if ( a==null ) { return this; } BitSet s = (BitSet)this.clone(); s.orInPlace((BitSet)a); return s; }
/** return this | a in a new set */ public IntSet or(IntSet a) { if ( a==null ) { return this; } BitSet s = (BitSet)this.clone(); s.orInPlace((BitSet)a); return s; }
/** return this | a in a new set */ public IntSet or(IntSet a) { if ( a==null ) { return this; } BitSet s = (BitSet)this.clone(); s.orInPlace((BitSet)a); return s; }
@Override public void addAll(IntSet set) { if ( set instanceof BitSet ) { this.orInPlace((BitSet)set); } else if ( set instanceof IntervalSet ) { IntervalSet other = (IntervalSet)set; // walk set and add each interval for (Interval I : other.intervals) { this.orInPlace(BitSet.range(I.a,I.b)); } } else { throw new IllegalArgumentException("can't add "+ set.getClass().getName()+ " to BitSet"); } }
public void addAll(IntSet set) { if ( set instanceof BitSet ) { this.orInPlace((BitSet)set); } else if ( set instanceof IntervalSet ) { IntervalSet other = (IntervalSet)set; // walk set and add each interval for (Iterator iter = other.intervals.iterator(); iter.hasNext();) { Interval I = (Interval) iter.next(); this.orInPlace(BitSet.range(I.a,I.b)); } } else { throw new IllegalArgumentException("can't add "+ set.getClass().getName()+ " to BitSet"); } }
public void addAll(IntSet set) { if ( set instanceof BitSet ) { this.orInPlace((BitSet)set); } else if ( set instanceof IntervalSet ) { IntervalSet other = (IntervalSet)set; // walk set and add each interval for (Iterator iter = other.intervals.iterator(); iter.hasNext();) { Interval I = (Interval) iter.next(); this.orInPlace(BitSet.range(I.a,I.b)); } } else { throw new IllegalArgumentException("can't add "+ set.getClass().getName()+ " to BitSet"); } }