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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations