Package org.opengis.feature
Interface FeatureAssociation
-
- All Superinterfaces:
Property
public interface FeatureAssociation extends Property
An instance of anFeatureAssociationRole
containing the associated feature.FeatureAssociation
can be instantiated by calls toFeatureAssociationRole.newInstance()
.- Since:
- 3.1
- See Also:
FeatureAssociationRole
-
-
Method Summary
Modifier and Type Method Description GenericName
getName()
Returns the name of this association as defined by its role.FeatureAssociationRole
getRole()
Returns information about the association.Feature
getValue()
Returns the associated feature, ornull
if none.Collection<Feature>
getValues()
Returns all features, or an empty collection if none.void
setValue(Feature value)
Sets the associated feature.void
setValues(Collection<? extends Feature> values)
Sets the features.
-
-
-
Method Detail
-
getName
GenericName getName()
Returns the name of this association as defined by its role. This convenience method delegates toFeatureAssociationRole.getName()
.
-
getRole
FeatureAssociationRole getRole()
Returns information about the association.- Returns:
- information about the association.
-
getValue
Feature getValue() throws MultiValuedPropertyException
Returns the associated feature, ornull
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 interfaceProperty
- Returns:
- the associated feature (may be
null
). - Throws:
MultiValuedPropertyException
- if this association contains more than one value.- See Also:
Feature.getPropertyValue(String)
-
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 an other method for performing more extensive validation. Implementations should document their validation process.- Parameters:
value
- the new value, ornull
.- Throws:
InvalidPropertyValueException
- if this method verifies argument validity and the given value does not met the association constraints.- See Also:
Feature.setPropertyValue(String, Object)
-
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).
- 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 an other 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.
-
-