Search in sources :

Example 76 with Classifier

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

the class ComponentImplementationImpl method getAllConnections.

/**
 * Get list of all connections of a component implementation in a given mode, including ancestor
 * implementations.  In case of refined connections the refined connection is returned in the list.
 *
 * @param mode Mode for which connections are to be retrieved.
 * @return List of connections
 */
public EList<Connection> getAllConnections(Mode mode) {
    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(mode);
        for (final Connection fe : currentItems) {
            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 77 with Classifier

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

the class ComponentImplementationImpl method getAllEventDataSources.

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

Example 78 with Classifier

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

the class ComponentTypeImpl method getAllFeatures.

/**
 * get list of all features of a component type, including ancestor features
 * In case of refined features the refined feature is returned.
 *
 * @return List of feature objects
 */
// XXX: [AADL 1 -> AADL 2] Added to make instantiation work.
public EList<Feature> getAllFeatures() {
    final EList<Classifier> ancestors = getSelfPlusAllExtended();
    final BasicEList<Feature> returnlist = new BasicEList<Feature>();
    // Process from farthest ancestor to self
    for (ListIterator<Classifier> li = ancestors.listIterator(ancestors.size()); li.hasPrevious(); ) {
        final ComponentType current = (ComponentType) li.previous();
        final EList<Feature> currentFeatures = current.getOwnedFeatures();
        if (currentFeatures != null) {
            for (Iterator<Feature> i = currentFeatures.iterator(); i.hasNext(); ) {
                final Feature fe = i.next();
                final Feature rfe = fe.getRefined();
                if (rfe != null) {
                    returnlist.remove(rfe);
                }
                returnlist.add(fe);
            }
        }
    }
    return returnlist;
}
Also used : ComponentType(org.osate.aadl2.ComponentType) BasicEList(org.eclipse.emf.common.util.BasicEList) Classifier(org.osate.aadl2.Classifier) Feature(org.osate.aadl2.Feature) AbstractFeature(org.osate.aadl2.AbstractFeature) ClassifierFeature(org.osate.aadl2.ClassifierFeature)

Example 79 with Classifier

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

the class ComponentTypeImpl method getAllFlowSpecifications.

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

Example 80 with Classifier

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

the class ComponentImplementationImpl method getAllSubprogramProxies.

/*
	 * (non-Javadoc)
	 *
	 * @see org.osate.aadl2.ComponentImplementation#getAllSubprogramProxies()
	 */
public EList<SubprogramProxy> getAllSubprogramProxies() {
    final EList<Classifier> ancestors = getSelfPlusAllExtended();
    final BasicEList<SubprogramProxy> result = new BasicEList<SubprogramProxy>();
    for (Classifier classifier : ancestors) {
        final ComponentImplementation current = (ComponentImplementation) classifier;
        result.addAll(current.getOwnedSubprogramProxies());
    }
    return result;
}
Also used : ComponentImplementation(org.osate.aadl2.ComponentImplementation) SubprogramProxy(org.osate.aadl2.SubprogramProxy) 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