use of org.geotoolkit.sml.xml.v100.ComponentType in project osate2 by osate.
the class ComponentTypeImpl method getAllModes.
/**
* Returns all the mode objects of a given type, including
* ancestor.
*
* @return EList of all mode objects
*/
// XXX: [AADL 1 -> AADL 2] Added to make instantiation and property lookup
// work.
// public EList<Mode> getAllModes() {
// EList<Classifier> ancestors = getSelfPlusAllExtended();
// final BasicEList<Mode> returnlist = new BasicEList<Mode>();
// for (Iterator<Classifier> it = ancestors.iterator(); it.hasNext();) {
// final ComponentType current = (ComponentType) it.next();
// returnlist.addAll(current.getOwnedModes());
// }
// return returnlist;
// }
public EList<Mode> getAllModes() {
EList<Classifier> ancestors = getSelfPlusAllExtended();
final BasicEList<Mode> returnlist = new BasicEList<Mode>();
for (ListIterator<Classifier> it = ancestors.listIterator(ancestors.size()); it.hasPrevious(); ) {
final ComponentType current = (ComponentType) it.previous();
returnlist.addAll(current.getOwnedModes());
}
return returnlist;
}
use of org.geotoolkit.sml.xml.v100.ComponentType in project osate2 by osate.
the class ComponentTypeImpl method getPropertyValueInternal.
public final void getPropertyValueInternal(final Property property, final PropertyAcc paa, final boolean fromInstanceSlaveCall, final boolean all) throws InvalidModelException {
/*
* First see if the property is defined in component's properties
* subclause (could merge this with the loop below, but I want to make
* the steps more explicit.)
*/
if (paa.addLocal(this)) {
if (!all) {
return;
}
}
// Next walk the component type hierarchy
// Avoid loops by stopping if we extend ourself
final Set<ComponentType> seen = new HashSet<ComponentType>();
ComponentType currentType = getExtended();
while (currentType != null && !seen.contains(currentType)) {
if (paa.addLocal(currentType)) {
if (!all) {
return;
}
}
seen.add(currentType);
currentType = currentType.getExtended();
}
}
use of org.geotoolkit.sml.xml.v100.ComponentType in project osate2 by osate.
the class ComponentTypeImpl method getAllModeTransitions.
/**
* Returns all the mode transition objects of a given type,
* including ancestor.
*
* @return EList of all mode transition objects
*/
// XXX: [AADL 1 -> AADL 2] Added to make instantiation work.
public EList<ModeTransition> getAllModeTransitions() {
EList<Classifier> ancestors = getSelfPlusAllExtended();
final BasicEList<ModeTransition> returnlist = new BasicEList<ModeTransition>();
for (Iterator<Classifier> it = ancestors.iterator(); it.hasNext(); ) {
final ComponentType current = (ComponentType) it.next();
returnlist.addAll(current.getOwnedModeTransitions());
}
return returnlist;
}
use of org.geotoolkit.sml.xml.v100.ComponentType in project osate2 by osate.
the class ComponentTypeImpl method getAllPrototypes.
/**
* Returns all the prototype objects of a given type, including
* ancestor.
*
* @return EList of all mode objects
*/
// XXX: [AADL 1 -> AADL 2] Added to make instantiation and property lookup
// work.
public EList<Prototype> getAllPrototypes() {
EList<Classifier> ancestors = getSelfPlusAllExtended();
final BasicEList<Prototype> returnlist = new BasicEList<Prototype>();
// Process from farthest ancestor to self
for (ListIterator<Classifier> li = ancestors.listIterator(ancestors.size()); li.hasPrevious(); ) {
final ComponentType current = (ComponentType) li.previous();
final EList<Prototype> currentItems = current.getOwnedPrototypes();
if (currentItems != null) {
for (Iterator<Prototype> i = currentItems.iterator(); i.hasNext(); ) {
final Prototype fe = i.next();
final Prototype rfe = fe.getRefined();
if (rfe != null) {
returnlist.remove(rfe);
}
returnlist.add(fe);
}
}
}
return returnlist;
}
use of org.geotoolkit.sml.xml.v100.ComponentType in project osate2 by osate.
the class ComponentTypeRenameImpl method setRenamedComponentType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRenamedComponentType(ComponentType newRenamedComponentType) {
ComponentType oldRenamedComponentType = renamedComponentType;
renamedComponentType = newRenamedComponentType;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.COMPONENT_TYPE_RENAME__RENAMED_COMPONENT_TYPE, oldRenamedComponentType, renamedComponentType));
}
}
Aggregations