Package org.apache.sis.feature
Class AssociationView.Singleton
java.lang.Object
org.apache.sis.feature.Property
org.apache.sis.feature.Field<AbstractFeature>
org.apache.sis.feature.AbstractAssociation
org.apache.sis.feature.AssociationView
org.apache.sis.feature.AssociationView.Singleton
- All Implemented Interfaces:
Serializable
,Cloneable
- Enclosing class:
- AssociationView
Specialization of
AssociationView
when the amount of values can be only zero or one.
This implementation takes shortcuts for the getValue()
and getValues()
methods.
This specialization is provided because it is the most common case.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.feature.AssociationView
feature, name
Fields inherited from class org.apache.sis.feature.AbstractAssociation
role
-
Constructor Summary
ConstructorsConstructorDescriptionSingleton
(AbstractFeature feature, DefaultAssociationRole role) Creates a new association which will delegate its work to the given feature. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Returns the single value, ornull
if none.Wraps the property value in a set.void
setValue
(AbstractFeature value) Sets the value of this association.Methods inherited from class org.apache.sis.feature.AssociationView
create, equals, getName, hashCode, setValues, toString
Methods inherited from class org.apache.sis.feature.AbstractAssociation
clone, create, create, ensureValid, getRole, quality
Methods inherited from class org.apache.sis.feature.Field
isDeprecated, isSingleton
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Singleton
Singleton(AbstractFeature feature, DefaultAssociationRole role) Creates a new association which will delegate its work to the given feature.
-
-
Method Details
-
getValue
Returns the single value, ornull
if none.- Overrides:
getValue
in classAssociationView
- Returns:
- the associated feature (may be
null
). - See Also:
-
setValue
Sets the value of this association. This method assumes that theFeature.setPropertyValue(String, Object)
implementation will verify the argument type.- Overrides:
setValue
in classAssociationView
- Parameters:
value
- the new value, ornull
.- See Also:
-
getValues
Wraps the property value in a set.- Overrides:
getValues
in classAssociationView
- Returns:
- the features in a live collection.
-