Class StreamSampler


  • public class StreamSampler
    extends Object
    A random sampler on a stream of a known size.
    Author:
    Eyal Schneider
    • Constructor Detail

      • StreamSampler

        public StreamSampler​(Random rnd,
                             int streamSize,
                             int toSample)
        Constructor
        Parameters:
        streamSize - The total size of the stream.
        toSample - The number of items to be sampled
    • Method Detail

      • accept

        public boolean accept()
        To be called per visited item.
        Returns: