Package org.hcjf.utils
Class SynchronizedCountOperation
- java.lang.Object
-
- org.hcjf.utils.SynchronizedCountOperation
-
public final class SynchronizedCountOperation extends java.lang.ObjectThis class execute some operation periodically with some accumulated value. The period of execution is evaluated for each input but there aren't any timer or thread running for each counter instance.- Author:
- javaito.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSynchronizedCountOperation.Operation
-
Constructor Summary
Constructors Constructor Description SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, int maxCount)SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, int maxCount, long maxTime)SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, long maxTime)
-
Method Summary
Modifier and Type Method Description voidadd(double value)doublegetCurrentValue()static SynchronizedCountOperation.OperationgetHarmonicMeanOperation()static SynchronizedCountOperation.OperationgetMeanOperation()
-
-
-
Constructor Detail
-
SynchronizedCountOperation
public SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, int maxCount, long maxTime)
-
SynchronizedCountOperation
public SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, int maxCount)
-
SynchronizedCountOperation
public SynchronizedCountOperation(SynchronizedCountOperation.Operation operation, long maxTime)
-
-
Method Detail
-
add
public void add(double value)
-
getCurrentValue
public double getCurrentValue()
-
getMeanOperation
public static SynchronizedCountOperation.Operation getMeanOperation()
-
getHarmonicMeanOperation
public static SynchronizedCountOperation.Operation getHarmonicMeanOperation()
-
-