pedviz.algorithms.filter
Class Filter

java.lang.Object
  extended by pedviz.algorithms.filter.Filter

public class Filter
extends java.lang.Object

This class represents a collection of conditions.

Author:
lukas forer

Field Summary
static int AND
          and operator.
static int OR
          or operator.
 
Constructor Summary
Filter()
          Creates a new Filter object.
Filter(int operator)
          Creates a new Filter object and the conditions are combined with the given operator.
 
Method Summary
 void addCondition(Condition condition)
          Adds a new condition to the collection.
 java.util.ArrayList<Node> execute(Graph graph)
          Executes all conditions on the given graph object and returns a collection of all valid nodes.
 int getOperator()
          Returns the operator.
 void setOperator(int operator)
          Sets the operator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final int AND
and operator.

See Also:
Constant Field Values

OR

public static final int OR
or operator.

See Also:
Constant Field Values
Constructor Detail

Filter

public Filter()
Creates a new Filter object.


Filter

public Filter(int operator)
Creates a new Filter object and the conditions are combined with the given operator.

Parameters:
operator - operator (AND/OR)
Method Detail

addCondition

public void addCondition(Condition condition)
Adds a new condition to the collection.

Parameters:
condition -

execute

public java.util.ArrayList<Node> execute(Graph graph)
Executes all conditions on the given graph object and returns a collection of all valid nodes.

Parameters:
graph - Graph object
Returns:
a collection of all valid nodes.

getOperator

public int getOperator()
Returns the operator.

Returns:
the operator.

setOperator

public void setOperator(int operator)
Sets the operator.

Parameters:
operator - operator.