Class UniformReservoir

    • Constructor Detail

      • UniformReservoir

        public UniformReservoir()
        Creates a new UniformReservoir of 1028 elements, which offers a 99.9% confidence level with a 5% margin of error assuming a normal distribution.
      • UniformReservoir

        public UniformReservoir​(int size)
        Creates a new UniformReservoir.
        Parameters:
        size - the number of samples to keep in the sampling reservoir
    • Method Detail

      • size

        public int size()
        Description copied from interface: Reservoir
        Returns the number of values recorded.
        Specified by:
        size in interface Reservoir
        Returns:
        the number of values recorded
      • update

        public void update​(long value)
        Description copied from interface: Reservoir
        Adds a new recorded value to the reservoir.
        Specified by:
        update in interface Reservoir
        Parameters:
        value - a new recorded value
      • getSnapshot

        public Snapshot getSnapshot()
        Description copied from interface: Reservoir
        Returns a snapshot of the reservoir's values.
        Specified by:
        getSnapshot in interface Reservoir
        Returns:
        a snapshot of the reservoir's values