net.sf.mpxj
Class GenericCriteria

java.lang.Object
  extended by net.sf.mpxj.GenericCriteria
Direct Known Subclasses:
GraphicalIndicatorCriteria

public class GenericCriteria
extends Object

This class represents the criteria used as part of an evaluation.


Constructor Summary
GenericCriteria(ProjectFile projectFile)
          Constructor.
 
Method Summary
 void addCriteria(GenericCriteria criteria)
          Adds a an item to the list of child criteria.
 boolean evaluate(FieldContainer container, Map<GenericCriteriaPrompt,Object> promptValues)
          Evaluate the criteria and return a boolean result.
 List<GenericCriteria> getCriteriaList()
          Retrieves the list of child criteria associated with the current criteria.
 FieldType getLeftValue()
          Retrieves the LHS of the expression.
 TestOperator getOperator()
          Retrieve the operator used in the test.
 Object getValue(int index)
          Retrieve the first value.
 void setLeftValue(FieldType value)
          Sets the LHS of the expression.
 void setOperator(TestOperator operator)
          Set the operator used in the test.
 void setRightValue(int index, Object value)
          Add the value to list of values to be used as part of the evaluation of this indicator.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericCriteria

public GenericCriteria(ProjectFile projectFile)
Constructor.

Parameters:
projectFile - parent project file
Method Detail

setLeftValue

public void setLeftValue(FieldType value)
Sets the LHS of the expression.

Parameters:
value - LHS value

getLeftValue

public FieldType getLeftValue()
Retrieves the LHS of the expression.

Returns:
LHS value

getOperator

public TestOperator getOperator()
Retrieve the operator used in the test.

Returns:
test operator

setOperator

public void setOperator(TestOperator operator)
Set the operator used in the test.

Parameters:
operator - test operator

setRightValue

public void setRightValue(int index,
                          Object value)
Add the value to list of values to be used as part of the evaluation of this indicator.

Parameters:
index - position in the list
value - evaluation value

getValue

public Object getValue(int index)
Retrieve the first value.

Parameters:
index - position in the list
Returns:
first value

evaluate

public boolean evaluate(FieldContainer container,
                        Map<GenericCriteriaPrompt,Object> promptValues)
Evaluate the criteria and return a boolean result.

Parameters:
container - field container
promptValues - responses to prompts
Returns:
boolean flag

getCriteriaList

public List<GenericCriteria> getCriteriaList()
Retrieves the list of child criteria associated with the current criteria.

Returns:
list of criteria

addCriteria

public void addCriteria(GenericCriteria criteria)
Adds a an item to the list of child criteria.

Parameters:
criteria - criteria item to add

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.