Package microsim.statistics.functions
Class SumArrayFunction.Integer
java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.functions.AbstractArrayFunction
microsim.statistics.functions.SumArrayFunction
microsim.statistics.functions.SumArrayFunction.Integer
- All Implemented Interfaces:
EventListener
,DoubleSource
,IntSource
,UpdatableSource
- Enclosing class:
SumArrayFunction
SumFunction operating on integer source values.
-
Nested Class Summary
Nested classes/interfaces inherited from class microsim.statistics.functions.SumArrayFunction
SumArrayFunction.Double, SumArrayFunction.Integer, SumArrayFunction.Long
Nested classes/interfaces inherited from interface microsim.statistics.DoubleSource
DoubleSource.Variables
Nested classes/interfaces inherited from interface microsim.statistics.IntSource
IntSource.Variables
-
Field Summary
Fields inherited from class microsim.statistics.functions.AbstractArrayFunction
dblSource, intSource, lngSource, type, TYPE_DBL, TYPE_INT, TYPE_LNG
Fields inherited from class microsim.statistics.functions.AbstractFunction
timeChecker
-
Constructor Summary
ConstructorDescriptionInteger
(@NonNull IntArraySource source) Create a sum function on an integer array source. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(int @NonNull [] data) Applies the function to the given array of integer values.double
getDoubleValue
(@Nullable Enum<?> variableID) Returns the double value corresponding to the given variableIDint
getIntValue
(@Nullable Enum<?> id) Returns the integer value corresponding to the givenvariableID
Methods inherited from class microsim.statistics.functions.AbstractArrayFunction
apply, apply, applyFunction
Methods inherited from class microsim.statistics.functions.AbstractFunction
isCheckingTime, onEvent, setCheckingTime, updateSource
-
Field Details
-
isum
protected int isum
-
-
Constructor Details
-
Integer
Create a sum function on an integer array source.- Parameters:
source
- The data source.- Throws:
NullPointerException
- whensource
isnull
.
-
-
Method Details
-
apply
public void apply(int @NonNull [] data) Applies the function to the given array of integer values.- Overrides:
apply
in classAbstractArrayFunction
- Parameters:
data
- A source array of values.- Throws:
NullPointerException
- whendata
isnull
.
-
getIntValue
Returns the integer value corresponding to the givenvariableID
- Specified by:
getIntValue
in interfaceIntSource
- Parameters:
id
- A unique identifier for a variable.- Returns:
- The current integer value of the required variable.
-
getDoubleValue
Returns the double value corresponding to the given variableID- Specified by:
getDoubleValue
in interfaceDoubleSource
- Parameters:
variableID
- A unique identifier for a variable.- Returns:
- The current double value of the required variable.
-