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 longFor cross-version compatibility.Fields inherited from class org.apache.sis.feature.AssociationView
feature, nameFields 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, ornullif none.Wraps the property value in a set.voidsetValue(AbstractFeature value) Sets the value of this association.Methods inherited from class org.apache.sis.feature.AssociationView
create, equals, getName, hashCode, setValues, toStringMethods inherited from class org.apache.sis.feature.AbstractAssociation
clone, create, create, ensureValid, getRole, qualityMethods 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, ornullif none.- Overrides:
getValuein 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:
setValuein classAssociationView- Parameters:
value- the new value, ornull.- See Also:
-
getValues
Wraps the property value in a set.- Overrides:
getValuesin classAssociationView- Returns:
- the features in a live collection.
-