Class FeatureSetting


  • public final class FeatureSetting
    extends Object
    Represents a value held by a feature of an object.
    • Constructor Summary

      Constructors 
      Constructor Description
      FeatureSetting​(org.eclipse.emf.ecore.EObject containedObject)
      Constructs a new containment feature setting for the given contained object.
      FeatureSetting​(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature)
      Constructs a new single-valued feature setting.
      FeatureSetting​(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
      Constructs a new feature setting.
    • Constructor Detail

      • FeatureSetting

        public FeatureSetting​(org.eclipse.emf.ecore.EObject owner,
                              org.eclipse.emf.ecore.EStructuralFeature feature,
                              int index)
        Constructs a new feature setting.
        Parameters:
        owner - the object holding a value (not null)
        feature - the specific feature holding a value for the object (not null)
        index - the index of a value in the list of feature values. Ignored if the feature is single-valued
      • FeatureSetting

        public FeatureSetting​(org.eclipse.emf.ecore.EObject owner,
                              org.eclipse.emf.ecore.EStructuralFeature feature)
        Constructs a new single-valued feature setting.
        Parameters:
        owner - the object holding a value (not null)
        feature - the specific single-valued feature holding a value for the object (not null)
      • FeatureSetting

        public FeatureSetting​(org.eclipse.emf.ecore.EObject containedObject)
        Constructs a new containment feature setting for the given contained object.
        Parameters:
        containedObject - not null. Must have a containing object
    • Method Detail

      • getOwner

        public org.eclipse.emf.ecore.EObject getOwner()
        Returns the object holding a value.
        Returns:
        the object holding a value (never null)
      • getFeature

        public org.eclipse.emf.ecore.EStructuralFeature getFeature()
        Returns the specific feature holding a value for the object.
        Returns:
        the specific feature holding a value for the object (never null)
      • getIndex

        public int getIndex()
        Returns the index of a value in the list of feature values. Returns 0 if the feature is single-valued.
        Returns:
        the value index
      • getFeatureIndex

        public FeatureIndex getFeatureIndex()
        Returns the feature and the index grouped together.
        Returns:
        the feature and the index grouped together (never null)
      • getValue

        public Object getValue()
        Returns the resolved value held by the feature of the object.
        Returns:
        the resolved value held by the feature of the object
      • isContainment

        public boolean isContainment()
        Returns whether this setting describes containment relationship.
        Returns:
        true if this setting describes containment relationship, false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object