use of org.osate.aadl2.ProcessorClassifier in project osate2 by osate.
the class AadlBaTypeChecker method timedActionCheck.
private boolean timedActionCheck(TimedAction ta) {
BehaviorTime resolvedTime = _fact.createBehaviorTime();
boolean result = behaviorTimeCheck((DeclarativeTime) ta.getLowerTime(), resolvedTime);
ta.setLowerTime(resolvedTime);
if (ta.getUpperTime() != null) {
resolvedTime = _fact.createBehaviorTime();
result &= behaviorTimeCheck((DeclarativeTime) ta.getUpperTime(), resolvedTime);
ta.setUpperTime(resolvedTime);
}
if (ta.isSetProcessorClassifier()) {
List<ProcessorClassifier> qnes = new ArrayList<ProcessorClassifier>(ta.getProcessorClassifier().size());
qnes.addAll(ta.getProcessorClassifier());
ta.unsetProcessorClassifier();
QualifiedNamedElement qne;
Classifier tmp;
for (int i = 0; i < qnes.size(); i++) {
qne = (QualifiedNamedElement) qnes.get(i);
tmp = (Classifier) uniqueNamedElementReferenceResolver(qne, TypeCheckRule.PROCESSOR_RULE);
if (tmp != null) {
try {
ta.getProcessorClassifier().add((ProcessorClassifier) tmp);
} catch (IllegalArgumentException e) {
// if the user set the same more than once.
System.out.println("catch IllegalArgumentException AadlTypeChecker");
}
} else {
result = false;
}
}
}
return result;
}
Aggregations