public void update ( final ReservoirItemsSketch < T > sketchIn ) { if ( sketchIn == null ) { return ; } final ReservoirItemsSketch < T > ris = ( sketchIn . getK ( ) <= maxK_ ? sketchIn : sketchIn . downsampledCopy ( maxK_ ) ) ; // can modify the sketch if we downsampled, otherwise may need to copy it final boolean isModifiable = ( sketchIn != ris ) ; if ( gadget_ == null ) { createNewGadget ( ris , isModifiable ) ; } else { twoWayMergeInternal ( ris , isModifiable ) ; } }
Union the given sketch . This method can be repeatedly called . If the given sketch is null it is interpreted as an empty sketch .