Package qupath.lib.lazy.interfaces
Interface LazyValue<S,T> 
- Type Parameters:
- S- type of the input object used to determine the value
- T- type of the output value
- All Known Subinterfaces:
- LazyBooleanValue<S>,- LazyNumericValue<S>,- LazyStringValue<S>
- All Known Implementing Classes:
- MeasurementListValue
public interface LazyValue<S,T> 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant representing that the default number of decimal places should be used to convert floating point numbers to strings.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <S,T> LazyValue <S, T> Create aLazyValuewith specified name and help text.static <S> LazyBooleanValue<S> createBoolean(String name, String helpText, Function<S, Boolean> fun) Create aLazyBooleanValuewith specified name and help text.static <S> LazyNumericValue<S> createNumeric(String name, String helpText, Function<S, Number> fun) Create aLazyNumericValuewith specified name and help text.static <S> LazyStringValue<S> createString(String name, String helpText, Function<S, String> fun) Create aLazyStringValuewith specified name and help text.Optional help text that explained the value.Get the generic type of the measurement.getName()The name of the value.default StringgetStringValue(S input) Get a default string representation of an object measurement.default StringgetStringValue(S input, int decimalPlaces) Get a default string representation of an object measurement.Calculate a value from the input.default booleanCheck whether the value returned by this measurement is an instance ofBoolean.default booleanCheck whether the value returned by this measurement is an instance ofNumber.default booleanisString()Check whether the value returned by this measurement is an instance ofString.
- 
Field Details- 
DEFAULT_DECIMAL_PLACESstatic final int DEFAULT_DECIMAL_PLACESConstant representing that the default number of decimal places should be used to convert floating point numbers to strings.- See Also:
 
 
- 
- 
Method Details- 
createstatic <S,T> LazyValue<S,T> create(String name, String helpText, Function<S, T> fun, Class<T> valueType) Create aLazyValuewith specified name and help text.- Type Parameters:
- S- input type
- T- value type
- Parameters:
- name- name
- helpText- help text or description
- fun- function to calculate the value
- valueType- return type of the function
- Returns:
- a new lazy value
 
- 
createNumericCreate aLazyNumericValuewith specified name and help text.- Type Parameters:
- S- input type
- Parameters:
- name- name
- helpText- help text or description
- fun- function to calculate the value
- Returns:
- a new lazy value
 
- 
createStringCreate aLazyStringValuewith specified name and help text.- Type Parameters:
- S- input type
- Parameters:
- name- name
- helpText- help text or description
- fun- function to calculate the value
- Returns:
- a new lazy value
 
- 
createBooleanCreate aLazyBooleanValuewith specified name and help text.- Type Parameters:
- S- input type
- Parameters:
- name- name
- helpText- help text or description
- fun- function to calculate the value
- Returns:
- a new lazy value
 
- 
getNameString getName()The name of the value. When showing a measurement table, this would be the column header.- Returns:
- the name of the value
 
- 
getMeasurementTypeGet the generic type of the measurement.- Returns:
 
- 
isNumericdefault boolean isNumeric()Check whether the value returned by this measurement is an instance ofNumber.- Returns:
 
- 
isStringdefault boolean isString()Check whether the value returned by this measurement is an instance ofString.- Returns:
 
- 
isBooleandefault boolean isBoolean()Check whether the value returned by this measurement is an instance ofBoolean.- Returns:
 
- 
getValueCalculate a value from the input.- Parameters:
- input- the input that should be measured
- Returns:
- the output value
 
- 
getStringValueGet a default string representation of an object measurement.- Parameters:
- input- the object to measure
- decimalPlaces- number of decimal places; if < 0 then this will be calculated automatically
- Returns:
 
- 
getStringValueGet a default string representation of an object measurement. If the value is numeric, it is converted to a string using the default number of decimal places.- Parameters:
- input- the object to measure
- Returns:
- See Also:
 
- 
getHelpTextString getHelpText()Optional help text that explained the value. This may be displayed in a tooltip.- Returns:
- the help text, or null if no help text is available
 
 
-