com.mucommander.file.filter
Class ChainedFileFilter

java.lang.Object
  extended by com.mucommander.file.filter.FileFilter
      extended by com.mucommander.file.filter.ChainedFileFilter
Direct Known Subclasses:
AndFileFilter, OrFileFilter

public abstract class ChainedFileFilter
extends FileFilter

ChainedFileFilter combines one or several FileFilter to act as just one. addFileFilter(FileFilter) and removeFileFilter(FileFilter) allow to add or remove a FileFilter, getFileFilterIterator() to iterate through all the registered filters.

The AndFileFilter and OrFileFilter implementations match files that respectively match all of the registered filters, or any of them

.

Author:
Maxence Bernard
See Also:
AndFileFilter, OrFileFilter

Field Summary
protected  java.util.Vector filters
          List of registered FileFilter
 
Fields inherited from class com.mucommander.file.filter.FileFilter
inverted
 
Constructor Summary
ChainedFileFilter()
          Creates a new ChainedFileFilter that initially contains no FileFilter.
 
Method Summary
 void addFileFilter(FileFilter filter)
          Adds a new FileFilter to the list of chained filters.
 java.util.Iterator getFileFilterIterator()
          Returns an Iterator that traverses all the registered filters.
 boolean isEmpty()
          Returns true if this chained filter doesn't contain any file filter.
 void removeFileFilter(FileFilter filter)
          Removes a FileFilter to the list of chained filters.
 
Methods inherited from class com.mucommander.file.filter.FileFilter
accept, accept, filter, isInverted, match, match, reject, reject, setInverted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filters

protected java.util.Vector filters
List of registered FileFilter

Constructor Detail

ChainedFileFilter

public ChainedFileFilter()
Creates a new ChainedFileFilter that initially contains no FileFilter.

Method Detail

addFileFilter

public void addFileFilter(FileFilter filter)
Adds a new FileFilter to the list of chained filters.

Parameters:
filter - the FileFilter to add

removeFileFilter

public void removeFileFilter(FileFilter filter)
Removes a FileFilter to the list of chained filters. Does nothing if the given FileFilter is not contained by this ChainedFileFilter.

Parameters:
filter - the FileFilter to remove

getFileFilterIterator

public java.util.Iterator getFileFilterIterator()
Returns an Iterator that traverses all the registered filters.

Returns:
an Iterator that traverses all the registered filters.

isEmpty

public boolean isEmpty()
Returns true if this chained filter doesn't contain any file filter.

Returns:
true if this chained filter doesn't contain any file filter.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard