Search in sources :

Example 46 with ComponentType

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;
}
Also used : ComponentType(org.osate.aadl2.ComponentType) Mode(org.osate.aadl2.Mode) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier)

Example 47 with ComponentType

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();
    }
}
Also used : ComponentType(org.osate.aadl2.ComponentType) HashSet(java.util.HashSet)

Example 48 with ComponentType

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;
}
Also used : ComponentType(org.osate.aadl2.ComponentType) BasicEList(org.eclipse.emf.common.util.BasicEList) ModeTransition(org.osate.aadl2.ModeTransition) Classifier(org.osate.aadl2.Classifier)

Example 49 with ComponentType

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;
}
Also used : ComponentType(org.osate.aadl2.ComponentType) Prototype(org.osate.aadl2.Prototype) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier)

Example 50 with ComponentType

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));
    }
}
Also used : ComponentType(org.osate.aadl2.ComponentType) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

ComponentType (org.osate.aadl2.ComponentType)73 ComponentImplementation (org.osate.aadl2.ComponentImplementation)42 Classifier (org.osate.aadl2.Classifier)33 ComponentClassifier (org.osate.aadl2.ComponentClassifier)21 ArrayList (java.util.ArrayList)18 EObject (org.eclipse.emf.ecore.EObject)16 NamedElement (org.osate.aadl2.NamedElement)15 AnnexSubclause (org.osate.aadl2.AnnexSubclause)13 Feature (org.osate.aadl2.Feature)13 BasicEList (org.eclipse.emf.common.util.BasicEList)11 AadlPackage (org.osate.aadl2.AadlPackage)11 HashSet (java.util.HashSet)10 FeatureGroupType (org.osate.aadl2.FeatureGroupType)10 List (java.util.List)9 Subcomponent (org.osate.aadl2.Subcomponent)8 FeatureGroup (org.osate.aadl2.FeatureGroup)7 EList (org.eclipse.emf.common.util.EList)6 Property (org.osate.aadl2.Property)6 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)6 GetPropertyExpr (com.rockwellcollins.atc.agree.agree.GetPropertyExpr)5