com.usefullittlethings.saw.model
Interface FilterPluginIfc

All Superinterfaces:
PluginIfc
All Known Implementing Classes:
AbstractFilterPlugin, CompareTo, ContainsText, DateRange, ManualSelection, Mask, Size

public interface FilterPluginIfc
extends PluginIfc

Interface for filter plug-ins. Filter plug-ins remove items from a result list based on whether or not they meet certain criteria. Implementing this interface allows the plug-in to be dynamically loaded by the Search and Whatever application. Plug-ins will be loaded with the SearchController they correspond to, as determined by the values returned by the getResultClass method. For more information on developing plug-ins, refer to the Search and Whatever home page, [Developers] link.

See Also:
PluginIfc.getResultClass()

Field Summary
static java.lang.String CLASS_NAME
           
static int EXCLUDE
          Constant for exclude operations.
static int INCLUDE
          Constant for include operations.
 
Fields inherited from interface com.usefullittlethings.saw.model.PluginIfc
BLOCK, LINEAR, SINGLE_BLOCK, UNSUPPORTED
 
Method Summary
 void begin()
          This method of the plug-in will be invoked immediately before a search is performed, allowing the plug-in the "prepare" itself to perform a search.
 void end()
          This method of the plug-in will be invoked immediately after a search has completed, allowing the plug-in the perform any post-search clean-up activities..
 java.lang.Object exclude(int pattern, java.lang.Object target)
          Given a search pattern and a target, the plug-in must decide whether or not to exclude the target or the target contents.
 int getOperation()
          Returns the operation type currently assigned to this filter (include/exclude).
 java.lang.Object include(int pattern, java.lang.Object target)
          Given a search pattern and a target, the plug-in must decide whether or not to include the target or the target contents.
 void setBase(java.lang.Object base)
          This method is invoked at the beginning of each search to indicate the base reference point for the search.
 void setOperation(int type)
          Sets the operation type for this filter to INCLUDE or EXCLUDE.
 
Methods inherited from interface com.usefullittlethings.saw.model.PluginIfc
addObserver, clone, configure, configure, deleteObserver, getAuthor, getEmail, getName, getResultClass, getShortName, getState, getUI, getUnixName, getWebsite, hasUI, isEnabled, reset, setEnabled, supportCommandLine, supports, toXMLString
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values

INCLUDE

public static final int INCLUDE
Constant for include operations.

See Also:
Constant Field Values

EXCLUDE

public static final int EXCLUDE
Constant for exclude operations.

See Also:
Constant Field Values
Method Detail

setBase

public void setBase(java.lang.Object base)
This method is invoked at the beginning of each search to indicate the base reference point for the search. For example, for a file search it might be the folder or directory from which the search begins.

Parameters:
base - The base reference point for the current search operation

include

public java.lang.Object include(int pattern,
                                java.lang.Object target)
                         throws FilterInvocationException
Given a search pattern and a target, the plug-in must decide whether or not to include the target or the target contents.

Parameters:
pattern - The search pattern that is being applied to this search operation (LINEAR, BLOCK, SINGLE_BLOCK, etc.)
target - The object or object set that is to be filtered
Returns:
A reference to the target or a subset of the target's contents that have passed the filtering process
FilterInvocationException

exclude

public java.lang.Object exclude(int pattern,
                                java.lang.Object target)
                         throws FilterInvocationException
Given a search pattern and a target, the plug-in must decide whether or not to exclude the target or the target contents.

Parameters:
pattern - The search pattern that is being applied to this search operation (LINEAR, BLOCK, SINGLE_BLOCK, etc.)
target - The object or object set that is to be filtered
Returns:
A reference to the target or a subset of the target's contents that have passed the filtering process
FilterInvocationException

getOperation

public int getOperation()
Returns the operation type currently assigned to this filter (include/exclude).

Returns:
INCLUDE/EXCLUDE operation type

setOperation

public void setOperation(int type)
Sets the operation type for this filter to INCLUDE or EXCLUDE.

Parameters:
type - The type of operation to perform with this filter (INCLUDE or EXCLUDE)

begin

public void begin()
           throws FilterInvocationException
This method of the plug-in will be invoked immediately before a search is performed, allowing the plug-in the "prepare" itself to perform a search.

FilterInvocationException

end

public void end()
         throws FilterInvocationException
This method of the plug-in will be invoked immediately after a search has completed, allowing the plug-in the perform any post-search clean-up activities..

FilterInvocationException