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