edu.nrao.sss.model.parameter
Class ParameterFilter

java.lang.Object
  extended by edu.nrao.sss.model.parameter.ParameterFilter
All Implemented Interfaces:
Filter<Parameter>

public class ParameterFilter
extends Object
implements Filter<Parameter>

A filter that operates on parameters.

Revision Info:

$Revision: 230 $
$Date: 2007-01-02 14:37:07 -0700 (Tue, 02 Jan 2007) $
$Author: dharland $

Since:
2006-06-27
Author:
David M. Harland

Field Summary
static Pattern BLANK_PATTERN
           
 
Constructor Summary
ParameterFilter()
          Creates a new wide-open filter that allows all parameters to pass.
 
Method Summary
 boolean allows(Parameter param)
          Returns true if this filter allows the given parameter to pass through it.
 boolean blocks(Parameter param)
          Returns true if this filter blocks the given parameter.
 void clearAll()
          Sets this filter to a wide-open state.
 void clearBandPattern()
          Sets the band criterion to its wide-open state.
 void clearEntityPattern()
          Sets the entity criterion to its wide-open state.
 void clearModifiedByPattern()
          Sets the band criterion to its wide-open state.
 void clearParameterPattern()
          Sets the parameter criterion to its wide-open state.
 void clearValuePattern()
          Sets the value criterion to its wide-open state.
 void setBandPattern(Pattern regex)
          Sets a regular expression for matching the bands of parameters.
 void setEntityPattern(Pattern regex)
          Sets a regular expression for matching the entities of parameters.
 void setModifiedByPattern(Pattern regex)
          Sets a regular expression for matching the modifiedBy's of parameters.
 void setParameterPattern(Pattern regex)
          Sets a regular expression for matching the parameterss of parameters.
 void setValuePattern(Pattern regex)
          Sets a regular expression for matching the values of parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLANK_PATTERN

public static final Pattern BLANK_PATTERN
Constructor Detail

ParameterFilter

public ParameterFilter()
Creates a new wide-open filter that allows all parameters to pass.

Method Detail

allows

public boolean allows(Parameter param)
Returns true if this filter allows the given parameter to pass through it. Null parameters are always blocked.

The logic for allowing or blocking a parameter is somewhat complex. See blocks(Parameter) for details.

Specified by:
allows in interface Filter<Parameter>
Parameters:
param - the parameter to be filtered.
Returns:
true if this filter allows param to pass through it.

blocks

public boolean blocks(Parameter param)
Returns true if this filter blocks the given parameter. Null parameters are always blocked.

Specified by:
blocks in interface Filter<Parameter>
Parameters:
param - the parameter to be filtered.
Returns:
true if this filter blocks param.

clearAll

public void clearAll()
Sets this filter to a wide-open state. After this call all filtering criteria will be in their wide-open states and this filter will allow all parameters to pass.


clearBandPattern

public void clearBandPattern()
Sets the band criterion to its wide-open state.

See Also:
setBandPattern(Pattern)

clearEntityPattern

public void clearEntityPattern()
Sets the entity criterion to its wide-open state.

See Also:
setEntityPattern(Pattern)

clearModifiedByPattern

public void clearModifiedByPattern()
Sets the band criterion to its wide-open state.

See Also:
setModifiedByPattern(Pattern)

clearParameterPattern

public void clearParameterPattern()
Sets the parameter criterion to its wide-open state.

See Also:
setParameterPattern(Pattern)

clearValuePattern

public void clearValuePattern()
Sets the value criterion to its wide-open state.

See Also:
setValuePattern(Pattern)

setBandPattern

public void setBandPattern(Pattern regex)
Sets a regular expression for matching the bands of parameters. Only parameters whose bands are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their bands, call clearBandPattern().

Parameters:
regex - a regular expression for matching the bands of parameters.

setEntityPattern

public void setEntityPattern(Pattern regex)
Sets a regular expression for matching the entities of parameters. Only parameters whose entities are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their entity, call clearEntityPattern().

Parameters:
regex - a regular expression for matching the entityss of parameters.

setModifiedByPattern

public void setModifiedByPattern(Pattern regex)
Sets a regular expression for matching the modifiedBy's of parameters. Only parameters whose modifiedBy's are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their modifiedBy's, call clearModifiedByPattern().

Parameters:
regex - a regular expression for matching the modifiedBy's of parameters.

setParameterPattern

public void setParameterPattern(Pattern regex)
Sets a regular expression for matching the parameterss of parameters. Only parameters whose parameters are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their parameters, call clearParameterPattern().

Parameters:
regex - a regular expression for matching the parameterss of parameters.

setValuePattern

public void setValuePattern(Pattern regex)
Sets a regular expression for matching the values of parameters. Only parameters whose values are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their values, call clearValuePattern().

Parameters:
regex - a regular expression for matching the values of parameters.


Copyright © 2009. All Rights Reserved.