Interface FeatureAssociation

All Superinterfaces:
Property

public interface FeatureAssociation extends Property
An instance of an FeatureAssociationRole containing the associated feature. FeatureAssociation can be instantiated by calls to FeatureAssociationRole.newInstance().
Since:
3.1
See Also:
  • Method Details

    • getName

      GenericName getName()
      Returns the name of this association as defined by its role. This convenience method delegates to FeatureAssociationRole.getName().
      Specified by:
      getName in interface Property
      Returns:
      the association name specified by its role.
    • getRole

      Returns information about the association.
      Returns:
      information about the association.
    • getValue

      Returns the associated feature, or null if none. This convenience method can be invoked in the common case where the maximum number of features is restricted to 1 or 0.
      Specified by:
      getValue in interface Property
      Returns:
      the associated feature (may be null).
      Throws:
      MultiValuedPropertyException - if this association contains more than one value.
      See Also:
    • setValue

      void setValue(Feature value) throws InvalidPropertyValueException
      Sets the associated feature.
      Note on validation: the verifications performed by this method is implementation dependent. For performance reasons, an implementation may verify only the most basic constraints and offer another method for performing more extensive validation. Implementations should document their validation process.
      Parameters:
      value - the new value, or null.
      Throws:
      InvalidPropertyValueException - if this method verifies argument validity and the given value does not met the association constraints.
      See Also:
    • getValues

      Collection<Feature> getValues()
      Returns all features, or an empty collection if none.
      Implementation note: there is different approaches in the way that collection elements are related to this property values:
      • The collection may be a snapshot of property values at the method invocation time.
      • The collection may be an unmodifiable view of properties values.
      • The collection may be live (changes in the collection are reflected in this association, and vis-versa).
      This method does not mandate a particular approach. However, implementations should document which policy they choose.
      Returns:
      the features.
    • setValues

      void setValues(Collection<? extends Feature> values) throws InvalidPropertyValueException
      Sets the features. All previous values are replaced by the given collection.
      Note on validation: the verifications performed by this method is implementation dependent. For performance reasons, an implementation may verify only the most basic constraints and offer another method for performing more extensive validation. Implementations should document their validation process.
      Parameters:
      values - the new values.
      Throws:
      InvalidPropertyValueException - if this method verifies argument validity and the given values do not met the association constraints.