Class PopCntMonitor
java.lang.Object
io.github.olyutorskii.aletojio.idling.AbstractRndMonitor
io.github.olyutorskii.aletojio.idling.PopCntMonitor
- All Implemented Interfaces:
RndMonitor
Monitor pop-count of random number sequence.
- pop-count of 0x00000000 is 0
- pop-count of 0xa5a5a5a5 is 16
- pop-count of 0xffffffff is 32
Pop-count is another name for Hamming-weight.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
probeImpl
(int iVal) Implement ofAbstractRndMonitor.probe(int)
.protected void
Implement ofAbstractRndMonitor.reset()
.Methods inherited from class io.github.olyutorskii.aletojio.idling.AbstractRndMonitor
hasMet, probe, reset
-
Constructor Details
-
PopCntMonitor
Constructor.- Parameters:
pop
- pop counts (must be 0<= and <= 32)- Throws:
IllegalArgumentException
- pop counts too small or large
-
-
Method Details
-
resetImpl
protected void resetImpl()Implement ofAbstractRndMonitor.reset()
.- Specified by:
resetImpl
in classAbstractRndMonitor
-
probeImpl
protected boolean probeImpl(int iVal) Implement ofAbstractRndMonitor.probe(int)
.- Specified by:
probeImpl
in classAbstractRndMonitor
- Parameters:
iVal
- int value- Returns:
- true if
-