use of org.palladiosimulator.pcm.qosannotations.qos_performance.SystemSpecifiedExecutionTime in project Palladio-Editors-Sirius by PalladioSimulator.
the class ComposedProvidingRequiringEntityServices method getSystemSpecifiedExecutionTimesWithDistinctRoles.
/**
* filters the given {@link SystemSpecifiedExecutionTime}s to produce a collection with the first occurrences of SystemSpecifiedExecutionTime having distinct {@link Role}s
* @param ssets
* @return
*/
public Collection<SystemSpecifiedExecutionTime> getSystemSpecifiedExecutionTimesWithDistinctRoles(org.palladiosimulator.pcm.system.System system) {
Collection<SystemSpecifiedExecutionTime> result = new ArrayList<SystemSpecifiedExecutionTime>();
Collection<SystemSpecifiedExecutionTime> ssets = new ArrayList<SystemSpecifiedExecutionTime>();
EList<QoSAnnotations> annotations = system.getQosAnnotations_System();
for (QoSAnnotations annotation : annotations) {
for (SpecifiedQoSAnnotation specifiedAnnotation : annotation.getSpecifiedQoSAnnotations_QoSAnnotations()) {
if (specifiedAnnotation instanceof SystemSpecifiedExecutionTime) {
ssets.add((SystemSpecifiedExecutionTime) specifiedAnnotation);
}
}
}
for (SystemSpecifiedExecutionTime sset : ssets) {
if (sset.getRole_SpecifiedQoSAnnotation() != null && result.stream().noneMatch(x -> x.getRole_SpecifiedQoSAnnotation().equals(sset.getRole_SpecifiedQoSAnnotation())))
result.add(sset);
}
return result;
}
use of org.palladiosimulator.pcm.qosannotations.qos_performance.SystemSpecifiedExecutionTime in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSystemSpecifiedExecutionTime method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
SystemSpecifiedExecutionTime sset = (SystemSpecifiedExecutionTime) parameters.get("instance");
Signature sig = getSignature(sset);
for (SpecifiedQoSAnnotation s : sset.getQosAnnotations_SpecifiedQoSAnnotation().getSpecifiedQoSAnnotations_QoSAnnotations()) {
if ((s instanceof SystemSpecifiedExecutionTime) && (s.getSignature_SpecifiedQoSAnnation() != null) && (s.getRole_SpecifiedQoSAnnotation().equals(sset.getRole_SpecifiedQoSAnnotation())) && (s.getSignature_SpecifiedQoSAnnation().equals(sig)))
return;
}
sset.setSignature_SpecifiedQoSAnnation(sig);
}
Aggregations