

Public Member Functions | |
| FiltersVector () | |
| void | addFilter (Filter f, boolean active) |
| void | setFilters (Filter[] f, boolean[] active) |
| void | setFilters (FiltersVector flts) |
| int[] | getAppliedFiltersIndexes () |
| boolean | hasActiveFilters () |
| boolean | isActive (int n) |
| boolean | applyFilters (ILogEntry log) |
| String | getFilterString () |
| void | clear () |
| void | loadFilters (File f, boolean eraseFilters, String fileName) throws Exception |
| void | saveFilters (File f) throws IOException |
| Filter | remove (int index) |
| void | activateFilter (Filter f, boolean active) |
Private Member Functions | |
| File | convertOldFilterFile (File oldFile) throws Exception |
Private Attributes | |
| Vector< Integer > | activeFilters = new Vector<Integer>() |
This class stores all the filters defined by the user. It supports all the functionalities needed by the filters like load and save, the check if a log is compatible with the filters and so on
FiltersList is a Vector. It uses another vector to store the indexes of the active filters
| com::cosylab::logging::engine::FiltersVector::FiltersVector | ( | ) | [inline] |
Constructor
| void com::cosylab::logging::engine::FiltersVector::activateFilter | ( | Filter | f, | |
| boolean | active | |||
| ) | [inline] |
Activate/deactivate a filter
| f | The filter to activate/deactivate | |
| active | If true, activate the filter |
References activeFilters.
Referenced by com::cosylab::logging::settings::FilterChooserDialog::saveFilters().
| void com::cosylab::logging::engine::FiltersVector::addFilter | ( | Filter | f, | |
| boolean | active | |||
| ) | [inline] |
Add a filter to the vector. If it is active, its index is added to the vector of the active filters
| f | The filter to add | |
| active | true if the filter is active |
References activeFilters.
Referenced by com::cosylab::logging::engine::ACS::LCEngine::addFilter(), com::cosylab::logging::settings::FilterChooserDialog::applyFilters(), loadFilters(), alma::acs::logging::table::LogTableRowSorter::setFilters(), com::cosylab::logging::engine::ACS::LCEngine::setFilters(), alma::acs::logging::archive::zoom::FileHelper::setupFilters(), and alma::acs::jlog::test::EngineFilteringTest::testAddFiltersVector().
| boolean com::cosylab::logging::engine::FiltersVector::applyFilters | ( | ILogEntry | log | ) | [inline] |
Apply the (active) filters to a log
| log | The log to check |
References activeFilters.
Referenced by alma::acs::logging::tools::LogFileExtractor::logEntryReceived(), and com::cosylab::logging::engine::LogMatcher::match().
| void com::cosylab::logging::engine::FiltersVector::clear | ( | ) | [inline] |
Delete all the filters (and the active vector)
References activeFilters.
Referenced by com::cosylab::logging::settings::FilterChooserDialog::ButtonListener::actionPerformed(), loadFilters(), alma::acs::logging::table::LogTableRowSorter::setFilters(), com::cosylab::logging::engine::ACS::LCEngine::setFilters(), and setFilters().
| File com::cosylab::logging::engine::FiltersVector::convertOldFilterFile | ( | File | oldFile | ) | throws Exception [inline, private] |
Convert a filter file from the old to the new format The difference between the old stile and this new format is the presence of the history as well as the document type. At the present the history is not needed anymore but I keep this method for converting the xml type.
NOTE: This method will be removed
| f | The file to convert |
| <code>Exception</code> | In case of error converting the file |
Referenced by loadFilters().
| int [] com::cosylab::logging::engine::FiltersVector::getAppliedFiltersIndexes | ( | ) | [inline] |
Return the indexes of the active filters
References activeFilters.
Referenced by alma::acs::logging::table::LogTableRowFilter::buildTableFilters(), and com::cosylab::logging::settings::FilterChooserDialog::setupFields().
| String com::cosylab::logging::engine::FiltersVector::getFilterString | ( | ) | [inline] |
Returns the filter(s) applied as a string.
References activeFilters.
Referenced by alma::acs::logging::table::LogTableRowSorter::getFiltersString(), and com::cosylab::logging::engine::ACS::LCEngine::getFiltersString().
| boolean com::cosylab::logging::engine::FiltersVector::hasActiveFilters | ( | ) | [inline] |
Check if there are active filters
References activeFilters.
Referenced by com::cosylab::logging::engine::ACS::LCEngine::isFiltered(), com::cosylab::logging::LoggingClient::setEngineFilterLbl(), com::cosylab::logging::LoggingClient::setTableFilterLbl(), com::cosylab::logging::settings::FilterChooserDialog::setupFields(), and alma::acs::jlog::test::EngineFilteringTest::testAddFilter().
| boolean com::cosylab::logging::engine::FiltersVector::isActive | ( | int | n | ) | [inline] |
Return true if the filter is active
| n | The index of the filters |
References activeFilters.
Referenced by saveFilters(), alma::acs::logging::table::LogTableRowSorter::setFilters(), and com::cosylab::logging::engine::ACS::LCEngine::setFilters().
| void com::cosylab::logging::engine::FiltersVector::loadFilters | ( | File | f, | |
| boolean | eraseFilters, | |||
| String | fileName | |||
| ) | throws Exception [inline] |
Load filters In case of errors an exception is thrown
| f | The xml file to parse (java.io.File) | |
| eraseFilters | If true existing filters will be deleted before loading | |
| fileName | Is the name of the file (it is usually null and the name is read from the parameter f. However when this method is called recursively we need to pass the name because the file we're reading is a temporary file (generated by converting the original file) |
| <code>Exception</code> | In case of error loading the filters |
References addFilter(), clear(), and convertOldFilterFile().
Referenced by com::cosylab::logging::settings::FilterChooserDialog::loadFilters(), alma::acs::logging::tools::LogFileExtractor::LogFileExtractor(), and alma::acs::logging::dialogs::main::LogFrame::LogFrame().
| Filter com::cosylab::logging::engine::FiltersVector::remove | ( | int | index | ) | [inline] |
Remove an element from the FiltersVector (We need to override this method because we need to keep the activeFilters aligned)
References activeFilters.
Referenced by com::cosylab::logging::settings::FilterChooserDialog::ButtonListener::actionPerformed().
| void com::cosylab::logging::engine::FiltersVector::saveFilters | ( | File | f | ) | throws IOException [inline] |
Save the filters on a file
| f | The xml file to store the filters in (java.io.File) |
References isActive().
Referenced by com::cosylab::logging::settings::FilterChooserDialog::saveAsFilters(), and com::cosylab::logging::settings::FilterChooserDialog::saveFilters().
| void com::cosylab::logging::engine::FiltersVector::setFilters | ( | FiltersVector | flts | ) | [inline] |
Set the filters in this vector to be the same of the passed vector
| flts | The vector of filters |
References activeFilters, and clear().
| void com::cosylab::logging::engine::FiltersVector::setFilters | ( | Filter[] | f, | |
| boolean[] | active | |||
| ) | [inline] |
Set the filters in the vector deleting any other filter. The activeFilters vector is also updated
| filters | The array of filters to add | |
| active | The array of active filters |
References activeFilters, and clear().
Referenced by com::cosylab::logging::settings::FilterChooserDialog::restoreFilters(), alma::acs::logging::table::LogTableRowSorter::setFilters(), and com::cosylab::logging::settings::FilterChooserDialog::setFilters().
Vector<Integer> com::cosylab::logging::engine::FiltersVector::activeFilters = new Vector<Integer>() [private] |
Referenced by activateFilter(), addFilter(), applyFilters(), clear(), getAppliedFiltersIndexes(), getFilterString(), hasActiveFilters(), isActive(), remove(), and setFilters().
1.6.2