Search in sources :

Example 71 with Classifier

use of org.geotoolkit.sml.xml.v100.Classifier in project osate2 by osate.

the class ComponentImplementationImpl method getAllConnections.

/**
 * get list of all connection objects of a component implementation,
 * including ancestor features In case of refined connections the refined
 * connection is returned in the list.
 *
 * @return List of connection objects
 */
// XXX: [AADL 1 -> AADL 2] Added to make instantiation work.
public EList<Connection> getAllConnections() {
    final EList<Classifier> ancestors = getSelfPlusAllExtended();
    final BasicEList<Connection> returnlist = new BasicEList<Connection>();
    // Process from farthest ancestor to self
    for (ListIterator<Classifier> li = ancestors.listIterator(ancestors.size()); li.hasPrevious(); ) {
        final ComponentImplementation current = (ComponentImplementation) li.previous();
        final EList<Connection> currentItems = current.getOwnedConnections();
        if (currentItems != null) {
            for (Iterator<Connection> i = currentItems.iterator(); i.hasNext(); ) {
                final Connection fe = i.next();
                final Connection rfe = fe.getRefined();
                if (rfe != null) {
                    returnlist.remove(rfe);
                }
                returnlist.add(fe);
            }
        }
    }
    return returnlist;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) BasicEList(org.eclipse.emf.common.util.BasicEList) FeatureConnection(org.osate.aadl2.FeatureConnection) ParameterConnection(org.osate.aadl2.ParameterConnection) AccessConnection(org.osate.aadl2.AccessConnection) FeatureGroupConnection(org.osate.aadl2.FeatureGroupConnection) Connection(org.osate.aadl2.Connection) PortConnection(org.osate.aadl2.PortConnection) Classifier(org.osate.aadl2.Classifier)

Example 72 with Classifier

use of org.geotoolkit.sml.xml.v100.Classifier in project osate2 by osate.

the class ComponentImplementationImpl method getAllPrototypes.

/**
 * Returns all the mode objects of a given implementation, 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() {
    final BasicEList<Prototype> returnlist = new BasicEList<Prototype>();
    ComponentType type = getType();
    if (Aadl2Util.isNull(type)) {
        return returnlist;
    }
    EList<Classifier> ancestors = getType().getSelfPlusAllExtended();
    // 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);
            }
        }
    }
    ancestors = getSelfPlusAllExtended();
    // Process from farthest ancestor to self
    for (ListIterator<Classifier> li = ancestors.listIterator(ancestors.size()); li.hasPrevious(); ) {
        final ComponentImplementation current = (ComponentImplementation) 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 : ComponentImplementation(org.osate.aadl2.ComponentImplementation) ComponentType(org.osate.aadl2.ComponentType) Prototype(org.osate.aadl2.Prototype) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier)

Example 73 with Classifier

use of org.geotoolkit.sml.xml.v100.Classifier in project osate2 by osate.

the class ComponentImplementationImpl method getAllEventSources.

/*
	 * (non-Javadoc)
	 *
	 * @see org.osate.aadl2.ComponentImplementation#getAllEventSources()
	 */
public EList<EventSource> getAllEventSources() {
    final EList<Classifier> ancestors = getSelfPlusAllExtended();
    final BasicEList<EventSource> result = new BasicEList<EventSource>();
    for (Classifier classifier : ancestors) {
        final ComponentImplementation current = (ComponentImplementation) classifier;
        result.addAll(current.getOwnedEventSources());
    }
    return result;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) EventSource(org.osate.aadl2.EventSource) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier)

Example 74 with Classifier

use of org.geotoolkit.sml.xml.v100.Classifier in project osate2 by osate.

the class ComponentImplementationImpl method getAllModeTransitions.

/**
 * Returns all the mode transition objects of a given implementation,
 * 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 ComponentImplementation current = (ComponentImplementation) it.next();
        returnlist.addAll(current.getOwnedModeTransitions());
    }
    if (getType() == null) {
        return returnlist;
    }
    ancestors = getType().getSelfPlusAllExtended();
    for (Iterator<Classifier> it = ancestors.iterator(); it.hasNext(); ) {
        final ComponentType current = (ComponentType) it.next();
        returnlist.addAll(current.getOwnedModeTransitions());
    }
    return returnlist;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) ComponentType(org.osate.aadl2.ComponentType) BasicEList(org.eclipse.emf.common.util.BasicEList) ModeTransition(org.osate.aadl2.ModeTransition) Classifier(org.osate.aadl2.Classifier)

Example 75 with Classifier

use of org.geotoolkit.sml.xml.v100.Classifier in project osate2 by osate.

the class ComponentImplementationImpl method getAllModes.

/**
 * Returns all the mode objects of a given implementation, 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 ComponentImplementation current = (ComponentImplementation) it.next();
        returnlist.addAll(current.getOwnedModes());
    }
    ComponentType type = getType();
    if (Aadl2Util.isNull(type)) {
        return returnlist;
    }
    ancestors = getType().getSelfPlusAllExtended();
    for (Iterator<Classifier> it = ancestors.iterator(); it.hasNext(); ) {
        final ComponentType current = (ComponentType) it.next();
        returnlist.addAll(current.getOwnedModes());
    }
    return returnlist;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) ComponentType(org.osate.aadl2.ComponentType) Mode(org.osate.aadl2.Mode) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier)

Aggregations

Classifier (org.osate.aadl2.Classifier)203 ComponentClassifier (org.osate.aadl2.ComponentClassifier)90 ComponentImplementation (org.osate.aadl2.ComponentImplementation)49 NamedElement (org.osate.aadl2.NamedElement)40 AadlPackage (org.osate.aadl2.AadlPackage)38 Subcomponent (org.osate.aadl2.Subcomponent)37 ComponentType (org.osate.aadl2.ComponentType)34 EObject (org.eclipse.emf.ecore.EObject)31 ArrayList (java.util.ArrayList)29 BasicEList (org.eclipse.emf.common.util.BasicEList)28 Feature (org.osate.aadl2.Feature)26 DataClassifier (org.osate.aadl2.DataClassifier)22 FeatureGroupType (org.osate.aadl2.FeatureGroupType)21 ProcessorClassifier (org.osate.aadl2.ProcessorClassifier)21 AnnexSubclause (org.osate.aadl2.AnnexSubclause)17 Element (org.osate.aadl2.Element)17 EList (org.eclipse.emf.common.util.EList)15 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)15 FeatureGroup (org.osate.aadl2.FeatureGroup)14 PropertyExpression (org.osate.aadl2.PropertyExpression)14