Class AbstractRndMonitor

java.lang.Object
io.github.olyutorskii.aletojio.idling.AbstractRndMonitor
All Implemented Interfaces:
RndMonitor
Direct Known Subclasses:
BunchMonitor, ByteFreqMonitor, PopCntMonitor, UniqRunMonitor

public abstract class AbstractRndMonitor extends Object implements RndMonitor
Abstract RndMonitor implements.
  • Constructor Details

    • AbstractRndMonitor

      protected AbstractRndMonitor()
      Constructor.
  • Method Details

    • reset

      public void reset()
      Reset statistical status.
      Specified by:
      reset in interface RndMonitor
    • resetImpl

      protected abstract void resetImpl()
      Implement of reset().
    • probe

      public boolean probe(int iVal)
      Probe new random value.

      The statistical state of the past random sequence is recalculated.

      Once the statistical condition is met, it must continue to return true until RndMonitor.reset() is called.

      Specified by:
      probe in interface RndMonitor
      Parameters:
      iVal - new random value
      Returns:
      true if met statistical condition
    • probeImpl

      protected abstract boolean probeImpl(int iVal)
      Implement of probe(int).
      Parameters:
      iVal - int value
      Returns:
      true if
    • hasMet

      public boolean hasMet()
      Inspect statistical condition.

      Must return false immediately after constructor and RndMonitor.reset() calls.

      Once RndMonitor.probe(int) returns true, must continue to return true until RndMonitor.reset() called.

      Specified by:
      hasMet in interface RndMonitor
      Returns:
      true if met statistical condition.