Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class BooleanFilter

java.lang.Object
  extended by com.citra.filter.Filter
      extended by com.citra.filter.BooleanFilter
All Implemented Interfaces:
Serializable

public class BooleanFilter
extends Filter

A boolean filter.

See Also:
Serialized Form

Field Summary
protected  boolean value
          the boolean value the supplied objects are matched against.
 
Fields inherited from class com.citra.filter.Filter
acceptNull
 
Constructor Summary
BooleanFilter()
          Constructs a BooleanFilter that will match false values.
BooleanFilter(boolean condition)
          Constructs a BooleanFilter that will match values depending on condition.
 
Method Summary
 boolean accept(boolean b)
          Matches the boolean value b against the current filter.
 boolean accept(Object value)
          Decides whether to accept the value supplied.
 boolean getCondition()
          Returns the boolean value the supplied objects are matched against.
 Object getFilterPattern()
          Returns the object used as the filter pattern.
 void setCondition(boolean value)
          Sets the boolean value this filter is going to accept.
 void setFilterPattern(Object filter)
          Sets an object as the filter pattern.
 
Methods inherited from class com.citra.filter.Filter
getAcceptNull, setAcceptNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected boolean value
the boolean value the supplied objects are matched against.

Constructor Detail

BooleanFilter

public BooleanFilter()
Constructs a BooleanFilter that will match false values.


BooleanFilter

public BooleanFilter(boolean condition)
Constructs a BooleanFilter that will match values depending on condition.

Method Detail

accept

public boolean accept(Object value)
Decides whether to accept the value supplied.

Specified by:
accept in class Filter
Parameters:
value - the object we want to decide if it will be filtered or not.
Returns:
true if the object matched and should not be filtered out, false otherwise.

accept

public boolean accept(boolean b)
Matches the boolean value b against the current filter.

Parameters:
b - a boolean value
Returns:
true if the value matched

getCondition

public boolean getCondition()
Returns the boolean value the supplied objects are matched against.

Returns:
the boolean value the supplied objects are matched against.

setCondition

public void setCondition(boolean value)
Sets the boolean value this filter is going to accept.

Parameters:
value - the boolean value this filter is going to accept.

setFilterPattern

public void setFilterPattern(Object filter)
Sets an object as the filter pattern. Subclasses should provide an implementation that will probably first cast filter to the appropriate object.

Specified by:
setFilterPattern in class Filter
Parameters:
filter - the object to set as the filter pattern

getFilterPattern

public Object getFilterPattern()
Returns the object used as the filter pattern.

Specified by:
getFilterPattern in class Filter
Returns:
the object that is currently set as the filter pattern.

Copyright © 2011 Citra Technologies. All Rights Reserved.