public abstract class AbstractAssociation extends Object implements Cloneable, Serializable
AbstractAssociation
can be instantiated by calls to DefaultAssociationRole.newInstance()
.
AbstractAssociation
instances are not thread-safe.
Synchronization, if needed, shall be done externally by the caller.DefaultAssociationRole.newInstance()
,
Serialized FormDefined in the sis-feature
module
Modifier | Constructor and Description |
---|---|
protected |
AbstractAssociation(DefaultAssociationRole role)
Creates a new association of the given role.
|
Modifier and Type | Method and Description |
---|---|
AbstractAssociation |
clone()
Returns a copy of this association.
|
static AbstractAssociation |
create(DefaultAssociationRole role)
Creates a new association of the given role.
|
GenericName |
getName()
Returns the name of this association as defined by its role.
|
DefaultAssociationRole |
getRole()
Returns information about the association.
|
abstract AbstractFeature |
getValue()
Returns the associated feature, or
null if none. |
Collection<AbstractFeature> |
getValues()
Returns all features, or an empty collection if none.
|
DataQuality |
quality()
Verifies if the current association value mets the constraints defined by the association role.
|
abstract void |
setValue(AbstractFeature value)
Sets the associated feature.
|
void |
setValues(Collection<? extends AbstractFeature> values)
Sets the features.
|
String |
toString()
Returns a string representation of this association.
|
protected AbstractAssociation(DefaultAssociationRole role)
role
- Information about the association.create(DefaultAssociationRole)
public static AbstractAssociation create(DefaultAssociationRole role)
role
- Information about the association.DefaultAssociationRole.newInstance()
public GenericName getName()
AbstractIdentifiedType.getName()
.public DefaultAssociationRole getRole()
org.opengis.feature.AssociationRole
. This change is pending GeoAPI revision.public abstract AbstractFeature getValue()
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.
org.opengis.feature.Feature
. This change is pending GeoAPI revision.null
).IllegalStateException
- if this association contains more than one value.AbstractFeature.getPropertyValue(String)
public Collection<AbstractFeature> getValues()
Association
instance, and conversely.
The default implementation returns a collection which will delegate its work to
getValue()
and setValue(Object)
.
public abstract void setValue(AbstractFeature value) throws IllegalArgumentException
org.opengis.feature.Feature
. This change is pending GeoAPI revision.quality()
method.value
- The new value, or null
.IllegalArgumentException
- If the given feature is not valid for this association.AbstractFeature.setPropertyValue(String, Object)
public void setValues(Collection<? extends AbstractFeature> values) throws IllegalArgumentException
The default implementation ensures that the given collection contains at most one element,
then delegates to setValue(AbstractFeature)
.
values
- The new values.IllegalArgumentException
- if the given collection contains too many elements.public DataQuality quality()
AbstractAttribute.quality()
for an example.
This association is valid if this method does not report any
conformance result having a
pass value of false
.
AbstractFeature.quality()
@Debug public String toString()
public AbstractAssociation clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if this association can not be cloned.
The default implementation never throw this exception. However subclasses may throw it.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.