Public Member Functions

com.cosylab.logging.engine.FiltersVector Class Reference

Inherits java::util::Vector< Filter >.

List of all members.

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)

Detailed Description

Author:
acaproni

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


Constructor & Destructor Documentation

com.cosylab.logging.engine.FiltersVector.FiltersVector (  ) 

Constructor


Member Function Documentation

void com.cosylab.logging.engine.FiltersVector.activateFilter ( Filter  f,
boolean  active 
)

Activate/deactivate a filter

Parameters:
f The filter to activate/deactivate
active If true, activate the filter
void com.cosylab.logging.engine.FiltersVector.addFilter ( Filter  f,
boolean  active 
)

Add a filter to the vector. If it is active, its index is added to the vector of the active filters

Parameters:
f The filter to add
active true if the filter is active

Referenced by com.cosylab.logging.engine.ACS.LCEngine.addFilter(), com.cosylab.logging.engine.FiltersVector.loadFilters(), alma.acs.logging.table.LogTableRowSorter.setFilters(), and com.cosylab.logging.engine.ACS.LCEngine.setFilters().

boolean com.cosylab.logging.engine.FiltersVector.applyFilters ( ILogEntry  log  ) 

Apply the (active) filters to a log

Parameters:
log The log to check
Returns:
true if the log pass all the active filters check

Referenced by alma.acs.logging.tools.LogFileExtractor.logEntryReceived(), and com.cosylab.logging.engine.LogMatcher.match().

void com.cosylab.logging.engine.FiltersVector.clear (  ) 
int [] com.cosylab.logging.engine.FiltersVector.getAppliedFiltersIndexes (  ) 

Return the indexes of the active filters

Returns:
The array of the indexes of the active filters
String com.cosylab.logging.engine.FiltersVector.getFilterString (  ) 

Returns the filter(s) applied as a string.

Returns:
The string with the applied filters

Referenced by alma.acs.logging.table.LogTableRowSorter.getFiltersString(), and com.cosylab.logging.engine.ACS.LCEngine.getFiltersString().

boolean com.cosylab.logging.engine.FiltersVector.hasActiveFilters (  ) 

Check if there are active filters

Returns:
true if there are active filters

Referenced by com.cosylab.logging.engine.ACS.LCEngine.isFiltered().

boolean com.cosylab.logging.engine.FiltersVector.isActive ( int  n  ) 

Return true if the filter is active

Parameters:
n The index of the filters
Returns:
true if the filter is active

Referenced by com.cosylab.logging.engine.FiltersVector.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

Load filters In case of errors an exception is thrown

Parameters:
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)
Exceptions:
<code>Exception</code> In case of error loading the filters

References com.cosylab.logging.engine.FiltersVector.addFilter(), and com.cosylab.logging.engine.FiltersVector.clear().

Referenced by alma.acs.logging.tools.LogFileExtractor.LogFileExtractor(), and alma.acs.logging.dialogs.main.LogFrame.LogFrame().

Filter com.cosylab.logging.engine.FiltersVector.remove ( int  index  ) 

Remove an element from the FiltersVector (We need to override this method because we need to keep the activeFilters aligned)

void com.cosylab.logging.engine.FiltersVector.saveFilters ( File  f  )  throws IOException

Save the filters on a file

Parameters:
f The xml file to store the filters in (java.io.File)

References com.cosylab.logging.engine.FiltersVector.isActive().

void com.cosylab.logging.engine.FiltersVector.setFilters ( FiltersVector  flts  ) 

Set the filters in this vector to be the same of the passed vector

Parameters:
flts The vector of filters

References com.cosylab.logging.engine.FiltersVector.clear().

void com.cosylab.logging.engine.FiltersVector.setFilters ( Filter[]  f,
boolean[]  active 
)

Set the filters in the vector deleting any other filter. The activeFilters vector is also updated

Parameters:
filters The array of filters to add
active The array of active filters

References com.cosylab.logging.engine.FiltersVector.clear().

Referenced by alma.acs.logging.table.LogTableRowSorter.setFilters(), and com.cosylab.logging.settings.FilterChooserDialog.setFilters().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties