@Test public void testClone() { RoaringBitmap bitmap = RoaringBitmap.bitmapOf(1, 2, 3, 4, 5); IntIteratorFlyweight iter = new IntIteratorFlyweight(bitmap); PeekableIntIterator iterClone = iter.clone(); final List<Integer> iterList = asList(iter); final List<Integer> iterCloneList = asList(iterClone); assertEquals(iterList.toString(), iterCloneList.toString()); }
@Override public PeekableIntIterator clone() { try { IntIteratorFlyweight x = (IntIteratorFlyweight) super.clone(); if(this.iter != null) { x.iter = this.iter.clone(); } return x; } catch (CloneNotSupportedException e) { return null; } }
IntIteratorFlyweight implements PeekableIntIterator { @Override public PeekableIntIterator clone() { try { IntIteratorFlyweight x = (IntIteratorFlyweight) super.clone(); if(this.iter != null) { x.iter = this.iter.clone(); } return x; } catch (CloneNotSupportedException e) { return null; } } }
IntIteratorFlyweight implements PeekableIntIterator { @Override public PeekableIntIterator clone() { try { IntIteratorFlyweight x = (IntIteratorFlyweight) super.clone(); if(this.iter != null) { x.iter = this.iter.clone(); } return x; } catch (CloneNotSupportedException e) { return null; } } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); }
IntIteratorFlyweight implements PeekableIntIterator { @Override public PeekableIntIterator clone() { try { IntIteratorFlyweight x = (IntIteratorFlyweight) super.clone(); if(this.iter != null) { x.iter = this.iter.clone(); } return x; } catch (CloneNotSupportedException e) { return null; } } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); @Override PeekableIntIterator clone(); @Override boolean hasNext(); @Override int next(); void wrap(RoaringBitmap r); @Override void advanceIfNeeded(final int minval); @Override int peekNext(); }
IntIteratorFlyweight implements PeekableIntIterator { @Override public PeekableIntIterator clone() { try { IntIteratorFlyweight x = (IntIteratorFlyweight) super.clone(); if(this.iter != null) { x.iter = this.iter.clone(); } return x; } catch (CloneNotSupportedException e) { return null; } } IntIteratorFlyweight();  IntIteratorFlyweight(RoaringBitmap r); @Override PeekableIntIterator clone(); @Override boolean hasNext(); @Override int next(); void wrap(RoaringBitmap r); @Override void advanceIfNeeded(final int minval); @Override int peekNext();  }