FileDocCategorySizeDatePackage
CategoryExplorerLogRecordFilter.javaAPI DocApache log4j 1.2.153697Sat Aug 25 00:09:38 BST 2007org.apache.log4j.lf5.viewer.categoryexplorer

CategoryExplorerLogRecordFilter

public class CategoryExplorerLogRecordFilter extends Object implements LogRecordFilter
An implementation of LogRecordFilter based on a CategoryExplorerModel
author
Richard Wan

Fields Summary
protected CategoryExplorerModel
_model
Constructors Summary
public CategoryExplorerLogRecordFilter(CategoryExplorerModel model)

    _model = model;
  
Methods Summary
public booleanpasses(org.apache.log4j.lf5.LogRecord record)

return
true if the CategoryExplorer model specified at construction is accepting the category of the specified LogRecord. Has a side-effect of adding the CategoryPath of the LogRecord to the explorer model if the CategoryPath is new.

    CategoryPath path = new CategoryPath(record.getCategory());
    return _model.isCategoryPathActive(path);
  
public voidreset()
Resets the counters for the contained CategoryNodes to zero.

    resetAllNodes();
  
protected voidresetAllNodes()

    Enumeration nodes = _model.getRootCategoryNode().depthFirstEnumeration();
    CategoryNode current;
    while (nodes.hasMoreElements()) {
      current = (CategoryNode) nodes.nextElement();
      current.resetNumberOfContainedRecords();
      _model.nodeChanged(current);
    }