fable.utility.strategy
Class AuthorFilter

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

public class AuthorFilter
extends java.lang.Object
implements FilterStrategy

AuthorFilter is a filter that returns only articles that have (or are not written by) a particular author

Author:
Christopher Moh

Constructor Summary
AuthorFilter(java.lang.String author, boolean accept)
          Creates a new case-insensitive AuthorFilter
 
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

AuthorFilter

public AuthorFilter(java.lang.String author,
                    boolean accept)
Creates a new case-insensitive AuthorFilter

Parameters:
author - The Author
accept - true if we should only allow articles by this author, false if we should allow all articles EXCEPT by this author
Requires:
author != null
Effects:
Creates a new AuthorFilter
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