@ SuppressWarnings ( "unchecked" ) ReservoirItemsSketch < T > copy ( ) { return new ReservoirItemsSketch <> ( reservoirSize_ , currItemsAlloc_ , itemsSeen_ , rf_ , ( ArrayList < T > ) data_ . clone ( ) ) ; }
Used during union operations to ensure we do not overwrite an existing reservoir . Creates a shallow copy of the reservoir .