|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.domains.modal.kernel.RelationNode
public final class RelationNode
An instance of the RelationNode class stores the type and difference
information of a relation. For more details of type, see RelationType
.
For more details of difference, see
ParseTreeEvaluatorForGuardExpression
.
The instance stores the information of two evaluations of the transition,
the current evaluation and the previous evaluaiton.
Red (hyzheng) |
Yellow (hyzheng) |
Field Summary | |
---|---|
private int |
_currentType
|
private double |
_difference
|
private double |
_previousDifference
|
private int |
_previousType
|
Constructor Summary | |
---|---|
RelationNode(int type,
double difference)
Construct a relation node with given type and difference information. |
Method Summary | |
---|---|
void |
commit()
Update the previous type and difference information of this relation node with the current evaluation result. |
double |
getDifference()
Return the difference information from the current evaluation of the relation node. |
double |
getPreviousDifference()
Return the difference information from the previous evaluation of the relation node. |
boolean |
hasEvent()
Return true if the relation node has its type changed, and if the current type is equal/inequal or the current type changes from less_than to bigger_than or bigger_than to less_than. |
void |
reset()
Reset the relation node by setting the former type and difference information to RelationType.INVALID and 0.0 respectively. |
void |
setDifference(double difference)
Set the difference information with the current evaluation result of the relation node. |
void |
setType(int type)
Set the type information with the current evaluation result of the relation node. |
boolean |
typeChanged()
Return true if the type changed and the previous type information is valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int _currentType
private double _difference
private double _previousDifference
private int _previousType
Constructor Detail |
---|
public RelationNode(int type, double difference)
type
- The type, one of RelationType
.difference
- The difference.Method Detail |
---|
public void reset()
public void commit()
public double getDifference()
setDifference(double)
public double getPreviousDifference()
public boolean hasEvent()
public void setType(int type)
type
- The current type information.public void setDifference(double difference)
difference
- The current difference information.getDifference()
public boolean typeChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |