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