use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.
the class AadlUtil method hasOutgoingFeatureSubcomponents.
/**
* determine whether a component instance has subcomponents that can have
* outgoing connections
*
* @param subcompinstances list of sub component instances
*/
public static boolean hasOutgoingFeatureSubcomponents(EList<? extends ComponentInstance> subcompinstances) {
for (ComponentInstance o : subcompinstances) {
EList<FeatureInstance> filist = o.getFeatureInstances();
for (FeatureInstance fi : filist) {
Feature f = fi.getFeature();
if (isOutgoingFeature(f)) {
return true;
}
}
// subcomponent can be access source
ComponentCategory cat = o.getCategory();
if (cat == DATA || cat == BUS || cat == VIRTUAL_BUS || cat == SUBPROGRAM || cat == SUBPROGRAM_GROUP) {
return true;
}
}
return false;
}
use of com.google.cloud.vision.v1p4beta1.Feature 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 com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.
the class FeatureImpl method setRefined.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRefined(Feature newRefined) {
Feature oldRefined = refined;
refined = newRefined;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FEATURE__REFINED, oldRefined, refined));
}
}
use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.
the class FeatureImpl method getAllFeatureRefinements.
/*
* Return the feature and any of the features it refines
*
* @return EList of feature
*/
// XXX: [AADL 1 -> AADL 2] Added to make instantiation and property lookup
// work.
public EList<Feature> getAllFeatureRefinements() {
BasicEList<Feature> returnlist = new BasicEList<Feature>();
Feature more = this;
while (more != null) {
returnlist.add(more);
more = more.getRefined();
}
return returnlist;
}
use of com.google.cloud.vision.v1p4beta1.Feature in project osate2 by osate.
the class FeatureImpl method getPropertyValueInternal.
public void getPropertyValueInternal(final Property prop, final PropertyAcc pas, final boolean fromInstanceSlaveCall, final boolean all) throws InvalidModelException {
Classifier owner = getContainingClassifier();
if (pas.addLocalContained(this, owner) && !all || pas.addLocal(this)) {
if (!all) {
return;
}
}
// values from refined features
Feature refined = getRefined();
while (refined != null) {
if (pas.addLocalContained(refined, refined.getContainingClassifier())) {
if (!all) {
return;
}
}
if (pas.addLocal(refined)) {
if (!all) {
return;
}
}
refined = refined.getRefined();
}
getPropertyValueInternalHelper(prop, pas, fromInstanceSlaveCall, all);
// feature group TYPE, not an implementation.
if (prop.isInherit()) {
owner.getPropertyValueInternal(prop, pas, fromInstanceSlaveCall, all);
}
}
Aggregations