use of org.geotoolkit.sml.xml.v100.ComponentType 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.ComponentType in project osate2 by osate.
the class ComponentImplementationImpl method getType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public ComponentType getType() {
ComponentType type = basicGetType();
type = type != null && ((EObject) type).eIsProxy() ? (ComponentType) eResolveProxy((InternalEObject) type) : type;
return // unresolved
type != null && ((EObject) type).eIsProxy() ? // unresolved
null : // proxy
type;
}
use of org.geotoolkit.sml.xml.v100.ComponentType 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.ComponentType 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;
}
use of org.geotoolkit.sml.xml.v100.ComponentType 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;
}
Aggregations