Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.logging
Class SelectiveFilter

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.logging.SelectiveFilter
All Implemented Interfaces:
Loggable, Filter
Direct Known Subclasses:
DebugFilter, ExceptionFilter, InfoFilter, MessageFilter, ProgressFilter, WarningFilter

public abstract class SelectiveFilter
extends AbstractLoggable
implements Filter

A selective filter filters exactly for a certain LogLevel of LogRecords.

Author:
Arthur Zimek

Field Summary
private  Level selectedLevel
          The level to filter for.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
protected SelectiveFilter(Level selectedLevel)
          Provides a selective filter for the given level.
 
Method Summary
 Level getLevel()
          Returns the currently set level of selection.
 boolean isLoggable(LogRecord record)
          Decides whether or not the given LogRecord is loggable.
 void setLevel(Level selectedLevel)
          Sets the selected level to the specified level.
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedLevel

private Level selectedLevel
The level to filter for.

Constructor Detail

SelectiveFilter

protected SelectiveFilter(Level selectedLevel)
Provides a selective filter for the given level.

Parameters:
selectedLevel - the level to filter for
Method Detail

setLevel

public void setLevel(Level selectedLevel)
Sets the selected level to the specified level.

Parameters:
selectedLevel - the level to filter for

getLevel

public Level getLevel()
Returns the currently set level of selection.

Returns:
the currently set level of selection

isLoggable

public boolean isLoggable(LogRecord record)
Decides whether or not the given LogRecord is loggable. Generally, a LogRecord is loggable iff the level of record equals the selectedLevel. More generous decisions may be implemented by extending classes.

Specified by:
isLoggable in interface Filter
Returns:
true if the level of record equals the selectedLevel, false otherwise
See Also:
Filter.isLoggable(java.util.logging.LogRecord)

Release 0.1 (2008-07-10_1838)