org.processmining.framework.log.filter
Class LogFilterCollection

java.lang.Object
  extended by org.processmining.framework.log.filter.LogFilterCollection

public class LogFilterCollection
extends java.lang.Object

Defines a collection of logFilters of a certain type.

This class is declared abstract, because subclasses need to specify which type of logFilters are accepted by the particular collection (i.e. they should override the abstract isValidlogFilter method).

Subclasses should also be implemented using the singleton pattern. This means that there is only a single collection of algorithms during the execution of the program.

In general, a subclass will look as follows:


 public class MyCollection extends logFilterCollection {
     private static MyCollection instance = null;

     protected MyCollection() {}

     public static MyCollection getInstance() {
         if (instance == null) {
            instance = new MyCollection();
         }
         return instance;
     }

     public boolean isValidlogFilter(logFilter logFilter) {
         return logFilter instanceof MylogFilter;
     }
 }
 

Version:
1.0
Author:
Peter van den Brand

Constructor Summary
protected LogFilterCollection()
           
 
Method Summary
 void add(LogFilter logFilter, java.lang.String sortName)
           
 LogFilter get(int index)
          Get a logFilter by its index in the collection.
 LogFilter get(java.lang.String name)
          Get a logFilter by its name.
static LogFilterCollection getInstance()
          Returns an instance of an MiningPluginCollection.
 void loadFromIni(java.lang.String filename, ProMSplash splash)
          Load logFilters from ini file.
 void loadFromList(java.lang.String list, ProMSplash splash)
          Load logFilters from a semi-colon separated list of class names.
 int size()
          Number of logFilters in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFilterCollection

protected LogFilterCollection()
Method Detail

getInstance

public static LogFilterCollection getInstance()
Returns an instance of an MiningPluginCollection.

Returns:
an instance of an MiningPluginCollection

loadFromIni

public void loadFromIni(java.lang.String filename,
                        ProMSplash splash)
Load logFilters from ini file. Each line in the ini file should be of the form Key=Value logFilters in the logFilter collection are sorted based on the Key in the ini file. The Value should be the full class name of the logFilter to load.

Parameters:
filename - ini file to load logFilters from
splash - splashscreen to write messages to

loadFromList

public void loadFromList(java.lang.String list,
                         ProMSplash splash)
Load logFilters from a semi-colon separated list of class names.

Parameters:
list - a semi-colon separated list of class names of logFilters
splash - the prom splashscreen to write messages to

size

public int size()
Number of logFilters in the collection.

Returns:
number of logFilters in the collection

get

public LogFilter get(int index)
Get a logFilter by its index in the collection.

Parameters:
index - the index of the logFilter in the list (in the range [0..size() - 1])
Returns:
the logFilter

get

public LogFilter get(java.lang.String name)
Get a logFilter by its name.

Parameters:
name - the name of the logFilter to get
Returns:
the logFilter if it's found in the collection, null otherwise

add

public void add(LogFilter logFilter,
                java.lang.String sortName)