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

com::cosylab::logging::engine::FiltersVector Class Reference

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)

Private Member Functions

File convertOldFilterFile (File oldFile) throws Exception

Private Attributes

Vector< Integer > activeFilters = new Vector<Integer>()

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  )  [inline]
 

Constructor


Member Function Documentation

void com::cosylab::logging::engine::FiltersVector::activateFilter Filter  f,
boolean  active
[inline]
 

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
[inline]
 

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

boolean com::cosylab::logging::engine::FiltersVector::applyFilters ILogEntry  log  )  [inline]
 

Apply the (active) filters to a log

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

void com::cosylab::logging::engine::FiltersVector::clear  )  [inline]
 

Delete all the filters (and the active vector)

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

Parameters:
f The file to convert
Returns:
The file with new format
Exceptions:
<code>Exception</code> In case of error converting the file

int [] com::cosylab::logging::engine::FiltersVector::getAppliedFiltersIndexes  )  [inline]
 

Return the indexes of the active filters

Returns:
The array of the indexes of the active filters

String com::cosylab::logging::engine::FiltersVector::getFilterString  )  [inline]
 

Returns the filter(s) applied as a string.

Returns:
The string with the applied filters

boolean com::cosylab::logging::engine::FiltersVector::hasActiveFilters  )  [inline]
 

Check if there are active filters

Returns:
true if there are active filters

boolean com::cosylab::logging::engine::FiltersVector::isActive int  n  )  [inline]
 

Return true if the filter is active

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

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

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

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)

void com::cosylab::logging::engine::FiltersVector::saveFilters File  f  )  throws IOException [inline]
 

Save the filters on a file

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

void com::cosylab::logging::engine::FiltersVector::setFilters FiltersVector  flts  )  [inline]
 

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

Parameters:
flts The vector of filters

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

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


Member Data Documentation

Vector<Integer> com::cosylab::logging::engine::FiltersVector::activeFilters = new Vector<Integer>() [private]
 


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