org.fuin.utils4j.filter
Class ListFilter

java.lang.Object
  extended by org.fuin.utils4j.filter.ListFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
AndFilter, OrFilter

public abstract class ListFilter
extends java.lang.Object
implements Filter

Defines a filter on a list of sub filters.


Field Summary
static java.lang.String DEFAULT_CLOSE_BRACKET
          Used to build a String representation out of this filter.
static java.lang.String DEFAULT_OPEN_BRACKET
          Used to build a String representation out of this filter.
 
Constructor Summary
ListFilter()
          Default constructor with no arguments.
ListFilter(Filter firstFilter, Filter secondFilter)
          Constructor with two terms.
 
Method Summary
 void addFilter(Filter filter)
          Adds another filter term to the list.
 java.lang.String getCloseBracket()
          Returns the String used as a closing bracket for the term.
 java.util.List getFilterList()
          Returns a list of all subfilters.
 java.lang.String getOpenBracket()
          Returns the String used as an opening bracket for the term.
 void removeFilter(Filter filter)
          Removes a filter term from the list.
 void setCloseBracket(java.lang.String newCloseBracket)
          Sets the String used as a closing bracket for the term.
 void setFilterList(java.util.List newList)
          Set a list of subfilters.
 void setOpenBracket(java.lang.String newOpenBracket)
          Sets the String used as an opening bracket for the term.
protected  java.lang.String toString(java.lang.String opStr)
          Helper for creating a String representation of the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.fuin.utils4j.filter.Filter
complies
 

Field Detail

DEFAULT_OPEN_BRACKET

public static final java.lang.String DEFAULT_OPEN_BRACKET
Used to build a String representation out of this filter.

See Also:
Constant Field Values

DEFAULT_CLOSE_BRACKET

public static final java.lang.String DEFAULT_CLOSE_BRACKET
Used to build a String representation out of this filter.

See Also:
Constant Field Values
Constructor Detail

ListFilter

public ListFilter()
Default constructor with no arguments.


ListFilter

public ListFilter(Filter firstFilter,
                  Filter secondFilter)
Constructor with two terms.

Parameters:
firstFilter - First filter part
secondFilter - Second filter part
Method Detail

addFilter

public final void addFilter(Filter filter)
Adds another filter term to the list.

Parameters:
filter - Part to be added

removeFilter

public final void removeFilter(Filter filter)
Removes a filter term from the list.

Parameters:
filter - Part to be removed

toString

protected final java.lang.String toString(java.lang.String opStr)
Helper for creating a String representation of the filter.

Parameters:
opStr - Name of the operator ("and", "or" ...)
Returns:
String with brackets

getCloseBracket

public final java.lang.String getCloseBracket()
Returns the String used as a closing bracket for the term.

Returns:
Bracket

getOpenBracket

public final java.lang.String getOpenBracket()
Returns the String used as an opening bracket for the term.

Returns:
Bracket

setCloseBracket

public final void setCloseBracket(java.lang.String newCloseBracket)
Sets the String used as a closing bracket for the term.

Parameters:
newCloseBracket - Bracket

setOpenBracket

public final void setOpenBracket(java.lang.String newOpenBracket)
Sets the String used as an opening bracket for the term.

Parameters:
newOpenBracket - Bracket

getFilterList

public final java.util.List getFilterList()
Returns a list of all subfilters. (Always non-NULL).

Returns:
List with Filter objects

setFilterList

public final void setFilterList(java.util.List newList)
Set a list of subfilters. A NULL argument will simply clear the internal. list.

Parameters:
newList - List with filters to be used


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.