

Public Member Functions | |
| LogTableRowFilter (FiltersVector filtersVector, LogTypeHelper logLevel) | |
| boolean | include (Entry<?extends LogTableDataModel,?extends Integer > entry) |
Private Member Functions | |
| void | buildTableFilters (FiltersVector userFilters) |
| boolean | checkLogLevel (LogTypeHelper level) |
Private Attributes | |
| Filter[] | filters = null |
| LogTypeHelper | logLevel = LogTypeHelper.TRACE |
The filters used to hide/show logs in the table.
The filters defined in the FiltersVector are entirely reused by this object. To enhance performances only the active filters are stored into an array built by the constructor. All the magic happens in the include method where the filters are compared against the values of a row of the table.
| alma::acs::logging::table::LogTableRowFilter::LogTableRowFilter | ( | FiltersVector | filtersVector, | |
| LogTypeHelper | logLevel | |||
| ) | [inline] |
Constructor
| filtersVector | The vector of engine filters (can be null or empty) | |
| logLevel | The log level of the logs to filter out |
References buildTableFilters().
| void alma::acs::logging::table::LogTableRowFilter::buildTableFilters | ( | FiltersVector | userFilters | ) | [inline, private] |
Convert the vector of filters to a LogTableRowFilter.
The engine and the dialog define filters by means of a vector of filters that has to be converted before being applied by this sorter. If the vector of filters is null or empty this object is set to null to improve performances. All the filters defined in the vector are added in AND because this is the way they are defined in the FiltersVector.
| userFilters | The user defined vector of filters |
RowSorter with all the filters in the passed parameter References filters, and com::cosylab::logging::engine::FiltersVector::getAppliedFiltersIndexes().
Referenced by LogTableRowFilter().
| boolean alma::acs::logging::table::LogTableRowFilter::checkLogLevel | ( | LogTypeHelper | level | ) | [inline, private] |
| boolean alma::acs::logging::table::LogTableRowFilter::include | ( | Entry<?extends LogTableDataModel,?extends Integer > | entry | ) | [inline] |
Compare the entry with the filters.
The entry represents a row of the table and it is possible to get the values of all the cells of the row using an index. The order of the columns is independent of the way the appear in the table and therefore is like this:
The filtering is done by getting the value to check against the filter from the column (index) containing it in entry. It is possible to know which field a filter wants to filter by reading the Filter.field property.
Once we have the filter and the value to filter, we can use filter.applyTo(Object obj) method to check if the row matches the filter.
| entry | The entry to check against filters |
true if the entry passed the filters and must be displayed in the table References com::cosylab::logging::engine::Filter::applyTo(), checkLogLevel(), com::cosylab::logging::engine::Filter::field, and filters.
Filter [] alma::acs::logging::table::LogTableRowFilter::filters = null [private] |
The array with the filters to apply to the entries.
This array is null but when there are filters. In this case, it contains anly the active filters read from the FiltersVector passed as parameter in the constructor.
Referenced by buildTableFilters(), and include().
LogTypeHelper alma::acs::logging::table::LogTableRowFilter::logLevel = LogTypeHelper.TRACE [private] |
The log level.
All the entries whose level is less then logLevel are filtered out of the table.
Referenced by checkLogLevel().
1.6.2