ptolemy.actor.gt.ingredients.criteria
Class Criterion

java.lang.Object
  extended by ptolemy.actor.gt.GTIngredient
      extended by ptolemy.actor.gt.ingredients.criteria.Criterion
Direct Known Subclasses:
AttributeCriterion, DynamicNameCriterion, GuardCriterion, NameCriterion, PortCriterion, StateTypeCriterion, SubclassCriterion

public abstract class Criterion
extends GTIngredient

A criterion to constrain an object in the host model.

Since:
Ptolemy II 8.0
Version:
$Id: Criterion.java 54815 2009-06-30 05:18:27Z tfeng $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.actor.gt.GTIngredient
GTIngredient.FieldIterator
 
Field Summary
 
Fields inherited from class ptolemy.actor.gt.GTIngredient
FIELD_SEPARATOR
 
Constructor Summary
Criterion(GTIngredientList owner, int elementCount)
          Construct a criterion within the given list as its owner containing a given number of elements.
 
Method Summary
 boolean canCheck(NamedObj object)
          Return whether this criterion can check the given object.
abstract  boolean match(NamedObj object)
          Test whether the given object in the host model matches the object in the pattern that has this criterion.
 
Methods inherited from class ptolemy.actor.gt.GTIngredient
_decodeBooleanField, _decodeStringField, _encodeBooleanField, _encodeStringField, _escapeElementString, _findMatchingParen, _findSeparator, _unescapeElementString, disableAll, enableAll, getElements, getOwner, getValue, getValues, isApplicable, isEnabled, setEnabled, setValue, setValues, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Criterion

public Criterion(GTIngredientList owner,
                 int elementCount)
Construct a criterion within the given list as its owner containing a given number of elements. All elements are enabled at the beginning.

Parameters:
owner - The list as the owner of the constructed GTIngredientList.
elementCount - The number of elements that the GTIngredient has.
Method Detail

canCheck

public boolean canCheck(NamedObj object)
Return whether this criterion can check the given object.

Parameters:
object - The object.
Returns:
true if the object can be checked.

match

public abstract boolean match(NamedObj object)
Test whether the given object in the host model matches the object in the pattern that has this criterion.

Parameters:
object - The object.
Returns:
true if the object matches.