public class PortCriterion extends Criterion
Red (tfeng) |
Yellow (tfeng) |
GTIngredient.FieldIterator
FIELD_SEPARATOR
Constructor and Description |
---|
PortCriterion(GTIngredientList owner)
Construct a criterion within the given list as its owner.
|
PortCriterion(GTIngredientList owner,
java.lang.String values)
Construct a criterion within the given list as its owner and initialize
all the elements with the given values, which are a string encoding of
those elements.
|
PortCriterion(GTIngredientList owner,
java.lang.String portName,
java.lang.String portType,
boolean input,
boolean output,
boolean multiport,
java.lang.String matcherName)
Construct a criterion within the given list as its owner and with the
given value to each of its elements..
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCheck(NamedObj object)
Return whether this criterion can check the given object.
|
GTIngredientElement[] |
getElements()
Get the array of elements defined in this GTIngredient.
|
java.lang.String |
getMatcherName()
Get the matcherName element.
|
java.lang.String |
getPortID(GTIngredientList list)
Get the ID of the port created for this criterion.
|
java.lang.String |
getPortName()
Get the portName element.
|
java.lang.String |
getPortType()
Get the portType element.
|
java.lang.Object |
getValue(int index)
Get the value of the index-th elements.
|
java.lang.String |
getValues()
Get a string that describes the values of all the elements.
|
boolean |
isApplicable(NamedObj object)
Check whether this GTIngredient is applicable to the object.
|
boolean |
isInput()
Get the input element.
|
boolean |
isInputEnabled()
Return whether the input element is enabled.
|
boolean |
isMatcherNameEnabled()
Return whether the matcherName element is enabled.
|
boolean |
isMultiport()
Get the multiport element.
|
boolean |
isMultiportEnabled()
Return whether the multiport element is enabled.
|
boolean |
isOutput()
Get the output element.
|
boolean |
isOutputEnabled()
Return whether the output element is enabled.
|
boolean |
isPortNameEnabled()
Return whether the portName element is enabled.
|
boolean |
isPortTypeEnabled()
Return whether the portType element is enabled.
|
boolean |
match(NamedObj object)
Test whether the given object in the host model matches the object in
the pattern that has this criterion.
|
void |
setInputEnabled(boolean enabled)
Enable or disable the input.
|
void |
setMatcherNameEnabled(boolean enabled)
Enable or disable the matcher name.
|
void |
setMultiportEnabled(boolean enabled)
Enable or disable the multiport.
|
void |
setOutputEnabled(boolean enabled)
Enable or disable the output.
|
void |
setPortNameEnabled(boolean enabled)
Enable or disable the port name.
|
void |
setPortTypeEnabled(boolean enabled)
Enable or disable the port type.
|
void |
setValue(int index,
java.lang.Object value)
Set the value of the index-th element.
|
void |
setValues(java.lang.String values)
Set the values of all the elements with a string that describes them.
|
void |
validate()
Validate the enablements and values of all the elements.
|
_decodeBooleanField, _decodeStringField, _encodeBooleanField, _encodeStringField, _escapeElementString, _findMatchingParen, _findSeparator, _unescapeElementString, disableAll, enableAll, getOwner, isEnabled, setEnabled, toString
public PortCriterion(GTIngredientList owner)
owner
- The list as the owner of the constructed GTIngredientList.public PortCriterion(GTIngredientList owner, java.lang.String values)
owner
- The list as the owner of the constructed GTIngredientList.values
- The string encoding of the values of the elements.public PortCriterion(GTIngredientList owner, java.lang.String portName, java.lang.String portType, boolean input, boolean output, boolean multiport, java.lang.String matcherName)
owner
- The list as the owner of the constructed GTIngredientList.portName
- Value of the portName element.portType
- Value of the portType element.input
- Value of the input element.output
- Value of the output element.multiport
- Value of the multiport element.matcherName
- Value of the matcherName element.public boolean canCheck(NamedObj object)
public GTIngredientElement[] getElements()
getElements
in class GTIngredient
public java.lang.String getMatcherName()
public java.lang.String getPortID(GTIngredientList list)
list
- The list in which the port ID should be unique.public java.lang.String getPortName()
public java.lang.String getPortType()
public java.lang.Object getValue(int index)
getValue
in class GTIngredient
index
- The index.setValue(int, Object)
public java.lang.String getValues()
getValues
in class GTIngredient
setValues(String)
public boolean isApplicable(NamedObj object)
isApplicable
in class GTIngredient
object
- The object.public boolean isInput()
public boolean isInputEnabled()
public boolean isMatcherNameEnabled()
public boolean isMultiport()
public boolean isMultiportEnabled()
public boolean isOutput()
public boolean isOutputEnabled()
public boolean isPortNameEnabled()
public boolean isPortTypeEnabled()
public boolean match(NamedObj object)
public void setInputEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setMatcherNameEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setMultiportEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setOutputEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setPortNameEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setPortTypeEnabled(boolean enabled)
Used as part of the test harness.
enabled
- true if the element is set to be enabled; false if it
is disabled.GTIngredient.setEnabled(int, boolean)
public void setValue(int index, java.lang.Object value)
setValue
in class GTIngredient
index
- The index.value
- The value.getValue(int)
public void setValues(java.lang.String values)
setValues
in class GTIngredient
values
- A string that describes the new values of all the
elements.getValues()
public void validate() throws ValidationException
validate
in class GTIngredient
ValidationException
- If some elements are invalid.