fable.utility.strategy
Class MarkFilter

java.lang.Object
  extended by fable.utility.strategy.MarkFilter
All Implemented Interfaces:
FilterStrategy

public class MarkFilter
extends java.lang.Object
implements FilterStrategy

MarkFilter filters out articles that have (or don't have) a certain mark

Author:
Christopher Moh

Constructor Summary
MarkFilter(Mark mark, boolean accept)
          Create a new MarkFilter
 
Method Summary
 boolean isOk(FableComponent t)
          Determines if the FableComponent should be allowed in the filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkFilter

public MarkFilter(Mark mark,
                  boolean accept)
Create a new MarkFilter

Parameters:
mark - The mark to check
accept - true if we should accept articles with ONLY this mark, false if we should accept ALL articles EXCEPT those with this mark
Effects:
Creates a new MarkFilter
Modifies:
this
Method Detail

isOk

public boolean isOk(FableComponent t)
Description copied from interface: FilterStrategy
Determines if the FableComponent should be allowed in the filter

Specified by:
isOk in interface FilterStrategy
Parameters:
t - FableComponent to check
Returns:
true if the FableComponent is allowed to pass, false otherwise