Package qupath.lib.gui.measure
Interface PathTableData<T>
- Type Parameters:
- T-
- All Known Implementing Classes:
- ObservableMeasurementTableData
public interface PathTableData<T>
Interface defining a table model that enables measurement names to be mapped to string or numeric values (as appropriate).
 
 This can be thought of a table, where items (often PathObject correspond to rows and named columns either return 
 numeric or String data.
 
This provides a useful method of wrapping one or more objects, and providing access to metadata, stored measurements and dynamically computed values in a way that is amenable to display within a table.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe default number of decimal places when converting floating point values to strings.static final StringThe default delimiter to use.
- 
Method SummaryModifier and TypeMethodDescriptionReturn an ordered list of all names, including both numeric measurements andStringvalues.double[]getDoubleValues(String name) Get all double values for all items.getItems()Get internal list of the items used to provide measurements.Get the names of all numeric measurements.doublegetNumericValue(T item, String name) Get the numeric value from an item for the specific measurement.Get a list of Strings representing table data for all items.getRowStrings(String delim, int nDecimalPlaces, Predicate<String> columnFilter) Get a list of Strings representing table data for all items.getRowStrings(Collection<? extends T> items, String delim, int nDecimalPlaces, Predicate<String> columnFilter) Get a list of Strings representing table data for specific items.getStringValue(T item, String name) Get a string representation of the value.getStringValue(T item, String name, int decimalPlaces) Get a string value, converting to a fixed number of decimal places if the column is numeric.
- 
Field Details- 
DEFAULT_DECIMAL_PLACESstatic final int DEFAULT_DECIMAL_PLACESThe default number of decimal places when converting floating point values to strings. This is permitted to change the number of decimal places based upon the magnitude of the value.- See Also:
 
- 
DEFAULT_DELIMITERThe default delimiter to use. This is a tab, to avoid confusion between decimal separators in different locales.- See Also:
 
 
- 
- 
Method Details- 
getAllNamesReturn an ordered list of all names, including both numeric measurements andStringvalues.- Returns:
- See Also:
 
- 
getStringValueGet a string representation of the value.For this method, numbers should be formatted according to the Locale.- Parameters:
- item-
- name-
- Returns:
 
- 
getStringValueGet a string value, converting to a fixed number of decimal places if the column is numeric.- Parameters:
- item-
- name-
- decimalPlaces-
- Returns:
 
- 
getMeasurementNamesGet the names of all numeric measurements.- Returns:
- See Also:
 
- 
getNumericValueGet the numeric value from an item for the specific measurement.- Parameters:
- item-
- name-
- Returns:
 
- 
getDoubleValuesGet all double values for all items.- Parameters:
- name-
- Returns:
 
- 
getItemsGet internal list of the items used to provide measurements.- Returns:
 
- 
getRowStringsGet a list of Strings representing table data for all items.This will use DEFAULT_DELIMITERandDEFAULT_DECIMAL_PLACES, with no column filter.- Returns:
- a list of strings, with the first item giving the column names and each additional string representing a row in the table
- Since:
- v0.6.0
 
- 
getRowStringsdefault List<String> getRowStrings(String delim, int nDecimalPlaces, Predicate<String> columnFilter) Get a list of Strings representing table data for all items.Each entry in the list corresponds to a row. This is equivalent to calling getRowStrings(getItems(), delim, nDecimalPlaces, columnFilter).- Parameters:
- delim- the delimiter to use between columns
- nDecimalPlaces- the number of decimal places to use for numeric values
- columnFilter- a predicate to choose which columns to include; if null, all columns from the table are used
- Returns:
- a list of strings, with the first item giving the column names and each additional string representing a row in the table
- Since:
- v0.6.0
 
- 
getRowStringsdefault List<String> getRowStrings(Collection<? extends T> items, String delim, int nDecimalPlaces, Predicate<String> columnFilter) Get a list of Strings representing table data for specific items.Each entry in the list corresponds to a row. - Parameters:
- items- the items to use; one row will be returned for each
- delim- the delimiter to use between columns
- nDecimalPlaces- the number of decimal places to use for numeric values; if negative, the default number of decimal places is used
- columnFilter- a predicate to choose which columns to include; if null, all columns from the table are used
- Returns:
- a list of strings, with the first item giving the column names and each additional string representing a row in the table
- Since:
- v0.6.0
 
 
-