org.eclipse.actf.validation.rules
Class AbstractCriterion

java.lang.Object
  extended by org.eclipse.actf.validation.rules.AbstractCriterion
All Implemented Interfaces:
ICriterion
Direct Known Subclasses:
AbstractRule, CompoundCriterion, NodeNameCriterion, PropertyCriterion, TypeCriterion

public abstract class AbstractCriterion
extends Object
implements ICriterion

Base implementation for a ICriterion

See Also:
ICriterion, TypeCriterion, PropertyCriterion, CompoundCriterion

Field Summary
protected  Map<String,String> attributes
           
protected  ICriterion parent
           
protected  List<ICriterion> parts
           
protected  IRuleSet ruleSet
           
 
Constructor Summary
AbstractCriterion()
           
 
Method Summary
 void addPart(ICriterion criterion)
          adds a criterion(or rule) to the list of criterion(rule parts or nested rules) that are executed when this Criterion(rule) is evaluated.
 boolean equals(Object other)
           
 String getAttribute(String name)
          retrieves the attribute with the given name for this rule
 ICriterion getParent()
          return the parent rule of this rule.
 ICriterion[] getParts()
          returns the criterion(rule) parts or nested criteria(rules) for the criterion/rule
 IRuleSet getRuleSet()
          return the IRuleSet containing this IRule.
 int hashCode()
           
 void setAttribute(String name, String value)
          set an arbitrary attribute for this rule
 void setParent(ICriterion parent)
          set the parent rule of this rule.
 void setParts(ICriterion[] criterion)
          set the criterion(rule) parts or nested criterion(rules) for this criterion(rule).
 void setRuleSet(IRuleSet ruleSet)
          Set the containing IRuleSet for this rule.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.actf.validation.rules.ICriterion
apply, initialize
 

Field Detail

parts

protected List<ICriterion> parts

attributes

protected Map<String,String> attributes

parent

protected ICriterion parent

ruleSet

protected IRuleSet ruleSet
Constructor Detail

AbstractCriterion

public AbstractCriterion()
Method Detail

addPart

public void addPart(ICriterion criterion)
Description copied from interface: ICriterion
adds a criterion(or rule) to the list of criterion(rule parts or nested rules) that are executed when this Criterion(rule) is evaluated.

Specified by:
addPart in interface ICriterion
Parameters:
criterion - - criterion which encapsulates rule

getParts

public ICriterion[] getParts()
Description copied from interface: ICriterion
returns the criterion(rule) parts or nested criteria(rules) for the criterion/rule

Specified by:
getParts in interface ICriterion
Returns:
list of criterion which may be an instanceof rules

setParts

public void setParts(ICriterion[] criterion)
Description copied from interface: ICriterion
set the criterion(rule) parts or nested criterion(rules) for this criterion(rule).

Specified by:
setParts in interface ICriterion
Parameters:
criterion - - list of encapsulated rules(Criterion)

getAttribute

public String getAttribute(String name)
Description copied from interface: ICriterion
retrieves the attribute with the given name for this rule

Specified by:
getAttribute in interface ICriterion
Parameters:
name - name of attribute
Returns:
attribute with given name or null

setAttribute

public void setAttribute(String name,
                         String value)
Description copied from interface: ICriterion
set an arbitrary attribute for this rule

Specified by:
setAttribute in interface ICriterion
Parameters:
name - name of attribute
value - value of attribute

getParent

public ICriterion getParent()
Description copied from interface: ICriterion
return the parent rule of this rule.

Specified by:
getParent in interface ICriterion
Returns:
instance of the parent rule

setParent

public void setParent(ICriterion parent)
Description copied from interface: ICriterion
set the parent rule of this rule. Rules can be nested. There are some fields that are set only on the parent rule for all nested rule parts.

Specified by:
setParent in interface ICriterion
Parameters:
parent - rule

getRuleSet

public IRuleSet getRuleSet()
Description copied from interface: ICriterion
return the IRuleSet containing this IRule.

Specified by:
getRuleSet in interface ICriterion
Returns:
instance of the containing IRuleSet

setRuleSet

public void setRuleSet(IRuleSet ruleSet)
Description copied from interface: ICriterion
Set the containing IRuleSet for this rule. A IRule is contained by only one IRuleSet.

Specified by:
setRuleSet in interface ICriterion
Parameters:
ruleSet - parent rule

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object