Search in sources :

Example 36 with Feature

use of com.google.cloud.vision.v1p3beta1.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;
}
Also used : BasicEList(org.eclipse.emf.common.util.BasicEList) Feature(org.osate.aadl2.Feature)

Example 37 with Feature

use of com.google.cloud.vision.v1p3beta1.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);
    }
}
Also used : FeatureClassifier(org.osate.aadl2.FeatureClassifier) ComponentClassifier(org.osate.aadl2.ComponentClassifier) Classifier(org.osate.aadl2.Classifier) Feature(org.osate.aadl2.Feature)

Example 38 with Feature

use of com.google.cloud.vision.v1p3beta1.Feature in project osate2 by osate.

the class FeatureImpl method getPropertyValue.

public void getPropertyValue(Property prop, PropertyAcc pas, Classifier cl, final boolean all) {
    Classifier owner = getContainingClassifier();
    // local contained value
    if (pas.addLocalContained(this, owner) && !all || pas.addLocal(this)) {
        if (!all) {
            return;
        }
    }
    // values from refined features
    Feature refined = getRefined();
    while (refined != null) {
        if (pas.addLocal(refined)) {
            if (!all) {
                return;
            }
        }
        refined = refined.getRefined();
    }
    getPropertyValueHelper(prop, pas, cl, all);
    // feature group TYPE, not an implementation.
    if (prop.isInherit()) {
        owner.getPropertyValueInternal(prop, pas, true, all);
    }
}
Also used : FeatureClassifier(org.osate.aadl2.FeatureClassifier) ComponentClassifier(org.osate.aadl2.ComponentClassifier) Classifier(org.osate.aadl2.Classifier) Feature(org.osate.aadl2.Feature)

Example 39 with Feature

use of com.google.cloud.vision.v1p3beta1.Feature in project osate2 by osate.

the class FeatureGroupTypeImpl method processFeatures.

private void processFeatures(final List<Feature> allFeatures, final List<Feature> refinedFeatures, final List<Feature> localFeatures) {
    /*
		 * Iterate backwards, so when we insert features at the start of the complete list, they
		 * still are inserted in the order of declaration. Keep the refined features in order because
		 * the types get visited from the bottom of the tree up, so the feature being refined will
		 * not have been added to the list yet.
		 */
    for (final ListIterator<Feature> listIter = localFeatures.listIterator(localFeatures.size()); listIter.hasPrevious(); ) {
        final Feature f = listIter.previous();
        final Feature r = f.getRefined();
        if (r == null) {
            allFeatures.add(0, f);
        } else {
            refinedFeatures.add(0, f);
        }
    }
}
Also used : Feature(org.osate.aadl2.Feature) AbstractFeature(org.osate.aadl2.AbstractFeature) ClassifierFeature(org.osate.aadl2.ClassifierFeature)

Example 40 with Feature

use of com.google.cloud.vision.v1p3beta1.Feature in project osate2 by osate.

the class FlowEndImpl method setFeature.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setFeature(Feature newFeature) {
    Feature oldFeature = feature;
    feature = newFeature;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FLOW_END__FEATURE, oldFeature, feature));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Feature(org.osate.aadl2.Feature)

Aggregations

Feature (org.osate.aadl2.Feature)86 ArrayList (java.util.ArrayList)82 Feature (com.google.cloud.vision.v1.Feature)74 AnnotateImageRequest (com.google.cloud.vision.v1.AnnotateImageRequest)71 Image (com.google.cloud.vision.v1.Image)71 BatchAnnotateImagesResponse (com.google.cloud.vision.v1.BatchAnnotateImagesResponse)68 ImageAnnotatorClient (com.google.cloud.vision.v1.ImageAnnotatorClient)68 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)65 ByteString (com.google.protobuf.ByteString)48 ImageSource (com.google.cloud.vision.v1.ImageSource)39 Subcomponent (org.osate.aadl2.Subcomponent)31 FileInputStream (java.io.FileInputStream)30 Classifier (org.osate.aadl2.Classifier)29 EntityAnnotation (com.google.cloud.vision.v1.EntityAnnotation)28 WebImage (com.google.cloud.vision.v1.WebDetection.WebImage)26 NamedElement (org.osate.aadl2.NamedElement)24 ComponentClassifier (org.osate.aadl2.ComponentClassifier)22 FeatureGroup (org.osate.aadl2.FeatureGroup)20 FeatureGroupType (org.osate.aadl2.FeatureGroupType)19 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)19