use of org.osate.ba.aadlba.ValueExpression in project osate2 by osate.
the class AssignmentActionImpl method basicSetValueExpression.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueExpression(ValueExpression newValueExpression, NotificationChain msgs) {
ValueExpression oldValueExpression = valueExpression;
valueExpression = newValueExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AadlBaPackage.ASSIGNMENT_ACTION__VALUE_EXPRESSION, oldValueExpression, newValueExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.ba.aadlba.ValueExpression in project osate2 by osate.
the class WhileOrDoUntilStatementImpl method basicSetLogicalValueExpression.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLogicalValueExpression(ValueExpression newLogicalValueExpression, NotificationChain msgs) {
ValueExpression oldLogicalValueExpression = logicalValueExpression;
logicalValueExpression = newLogicalValueExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AadlBaPackage.WHILE_OR_DO_UNTIL_STATEMENT__LOGICAL_VALUE_EXPRESSION, oldLogicalValueExpression, newLogicalValueExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.ba.aadlba.ValueExpression in project osate2 by osate.
the class PortSendActionImpl method basicSetValueExpression.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetValueExpression(ValueExpression newValueExpression, NotificationChain msgs) {
ValueExpression oldValueExpression = valueExpression;
valueExpression = newValueExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AadlBaPackage.PORT_SEND_ACTION__VALUE_EXPRESSION, oldValueExpression, newValueExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.ba.aadlba.ValueExpression in project osate2 by osate.
the class IfStatementImpl method basicSetLogicalValueExpression.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLogicalValueExpression(ValueExpression newLogicalValueExpression, NotificationChain msgs) {
ValueExpression oldLogicalValueExpression = logicalValueExpression;
logicalValueExpression = newLogicalValueExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AadlBaPackage.IF_STATEMENT__LOGICAL_VALUE_EXPRESSION, oldLogicalValueExpression, newLogicalValueExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.ba.aadlba.ValueExpression in project osate2 by osate.
the class AadlBaUtils method isOnlyOneValue.
/**
* If the given value expression is composed of an single value, it returns
* this value otherwise {@code null}. Recursive method.
*
* @param ve the given value expression
* @return the value or {@code null}
*/
public static Value isOnlyOneValue(ValueExpression ve) {
Relation firstRelation = ve.getRelations().get(0);
SimpleExpression firstSE = firstRelation.getFirstExpression();
Term firstTerm = firstSE.getTerms().get(0);
Factor firstFactor = firstTerm.getFactors().get(0);
Value firstValue = firstFactor.getFirstValue();
if (ve.getRelations().size() == 1) {
if (firstRelation.getSecondExpression() == null) {
if (firstSE.getTerms().size() == 1) {
if (firstTerm.getFactors().size() == 1) {
if (firstFactor.getSecondValue() == null) {
// Recursive case.
if (firstValue instanceof ValueExpression) {
return isOnlyOneValue((ValueExpression) firstValue);
} else {
return firstValue;
}
}
}
}
}
}
return null;
}
Aggregations