danger.content
Class AggregateFilter

java.lang.Object
  extended by danger.content.ContentFilter
      extended by danger.content.AggregateFilter


public class AggregateFilter
extends ContentFilter

A filter used to combine filters into more complex filters.

Here's an example of an aggregate filter that includes all audio types that are not an m3u playlist, and that are not under a particular directory:

              AggregateFilter filter = new AggregateFilter();

              MimeTypeFilter mimeTypeFilter = new MimeTypeFilter(false);
              mimeTypeFilter.includeGroup("audio");
              mimeTypeFilter.excludeType("audio/x-mpegurl");

              PathFilter pathFilter = new PathFilter(true);
              pathFilter.excludePath("/removable0/themes");

              filter.addFilter(mimeTypeFilter);
              filter.addFilter(pathFilter);
 


Constructor Summary
AggregateFilter()
          Create an new, empty aggregate filter.
 
Method Summary
 boolean accept(ContentFile file)
          The filtering logic.
 void addFilter(ContentFilter filter)
          Add a filter to this aggregate, to be processed in the order they are added.
 void dump()
          Used for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateFilter

public AggregateFilter()
Create an new, empty aggregate filter.

Method Detail

addFilter

public void addFilter(ContentFilter filter)
Add a filter to this aggregate, to be processed in the order they are added.


accept

public boolean accept(ContentFile file)
               throws StoreException
Description copied from class: ContentFilter
The filtering logic. Return true if the filter accepts the passed-in file, and false if not.

Specified by:
accept in class ContentFilter
Throws:
StoreException

dump

public void dump()
Description copied from class: ContentFilter
Used for debugging purposes.

Overrides:
dump in class ContentFilter