org.supermind.crawl.scope
Class AbstractScope<T>

java.lang.Object
  extended by org.supermind.crawl.scope.AbstractScope<T>
Direct Known Subclasses:
FetchListScope, ParseScope, PostFetchScope

public abstract class AbstractScope<T>
extends java.lang.Object

Limits the scope of an operation through ScopeFilters. ScopeFilters are run sequentially, in the same order that they are added.


Field Summary
protected  boolean allowByDefault
          Should isInScope(T) return true when all filters abstain?
protected  java.util.List<ScopeFilter> filters
           
 
Constructor Summary
AbstractScope()
           
 
Method Summary
 void add(ScopeFilter<T> filter)
          Add a ScopeFilter.
 boolean isInScope(T t)
          Is the parameter within this scope? If all filters abstain, allowByDefault is returned.
 void setAllowByDefault(boolean allowByDefault)
           
 void setFilters(java.util.List<ScopeFilter> filters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allowByDefault

protected boolean allowByDefault
Should isInScope(T) return true when all filters abstain?


filters

protected java.util.List<ScopeFilter> filters
Constructor Detail

AbstractScope

public AbstractScope()
Method Detail

add

public void add(ScopeFilter<T> filter)
Add a ScopeFilter.

Parameters:
filter -

isInScope

public boolean isInScope(T t)
Is the parameter within this scope? If all filters abstain, allowByDefault is returned.

Parameters:
t - input
Returns:

setAllowByDefault

public void setAllowByDefault(boolean allowByDefault)

setFilters

public void setFilters(java.util.List<ScopeFilter> filters)