Package microsim.reflection
Class DoubleValueExtractor
java.lang.Object
microsim.reflection.AbstractValueExtractor
microsim.reflection.DoubleValueExtractor
Employs Java reflection to call objects' methods which return double values.
-
Field Summary
Fields inherited from class microsim.reflection.AbstractValueExtractor
field, method, target
-
Constructor Summary
ConstructorDescriptionDoubleValueExtractor
(@NonNull Object target, @NonNull String fieldName, boolean isMethod) DoubleValueExtractor
(@Nullable Class<?> target, @NonNull String fieldName, boolean isMethod) -
Method Summary
Modifier and TypeMethodDescriptiondouble @NonNull []
getCollectionValue
(@NonNull Collection<?> c) double
Invoke the method of the object passed to constructor and return its double result.double
Invoke the method of the target object and return its double result.double
getDoubleValue
(int ignoredValueID) This is an implementation of theDoubleSource
interface.
-
Constructor Details
-
DoubleValueExtractor
-
DoubleValueExtractor
-
-
Method Details
-
getDouble
Invoke the method of the target object and return its double result.- Parameters:
target
- Object to be invoked.- Returns:
- The requested double value.
-
getDouble
public double getDouble()Invoke the method of the object passed to constructor and return its double result.- Returns:
- The requested double value.
-
getDoubleValue
public double getDoubleValue(int ignoredValueID) This is an implementation of theDoubleSource
interface. It calls thegetDouble()
method.- Parameters:
ignoredValueID
- This parameter is ignored. It is put for compatibility with theDoubleSource
interface.- Returns:
- The requested double value.
-
getCollectionValue
-