Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::table::LogTableRowFilter Class Reference

List of all members.

Public Member Functions

 LogTableRowFilter (FiltersVector filtersVector, LogTypeHelper logLevel)
Override 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

Detailed Description

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.

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::logging::table::LogTableRowFilter::LogTableRowFilter FiltersVector  filtersVector,
LogTypeHelper  logLevel
[inline]
 

Constructor

Parameters:
filtersVector The vector of engine filters (can be null or empty)
logLevel The log level of the logs to filter out


Member Function Documentation

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.

Parameters:
userFilters The user defined vector of filters
Returns:
The RowSorter with all the filters in the passed parameter

boolean alma::acs::logging::table::LogTableRowFilter::checkLogLevel LogTypeHelper  level  )  [inline, private]
 

Check if the level of the log passed as parameter matches with the log level

Parameters:
level The level to check
Returns:
true if the parameter is greater then the log level

Override 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:

  1. - Boolean (has data)
  2. - ILogEntry.Field.TIMESTAMP
  3. - ILogEntry.Field.ENTRYTYPE
  4. - ..

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.

Parameters:
entry The entry to check against filters
Returns:
true if the entry passed the filters and must be displayed in the table
See also:
RowFilter.include


Member Data Documentation

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.

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.


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:59 2009 for ACS Java API by doxygen 1.3.8