Package org.apache.sis.feature
Class AttributeView.Singleton<V>
java.lang.Object
org.apache.sis.feature.Property
org.apache.sis.feature.Field<V>
org.apache.sis.feature.AbstractAttribute<V>
org.apache.sis.feature.AttributeView<V>
org.apache.sis.feature.AttributeView.Singleton<V>
- Type Parameters:
V- the type of attribute values. If the attribute supports multi-occurrences, then this is the type of elements (not the collection type).
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AttributeView<V>
Specialization of
AttributeView 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.AttributeView
feature, nameFields inherited from class org.apache.sis.feature.AbstractAttribute
type -
Constructor Summary
ConstructorsConstructorDescriptionSingleton(AbstractFeature feature, DefaultAttributeType<V> type) Creates a new attribute which will delegate its work to the given feature. -
Method Summary
Methods inherited from class org.apache.sis.feature.AttributeView
characteristics, create, equals, getName, hashCode, setValues, toStringMethods inherited from class org.apache.sis.feature.AbstractAttribute
characteristicsReadOnly, clone, create, create, getType, 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, DefaultAttributeType<V> type) Creates a new attribute which will delegate its work to the given feature.
-
-
Method Details
-
getValue
Returns the single value, ornullif none.- Overrides:
getValuein classAttributeView<V>- Returns:
- the attribute value (may be
null). - See Also:
-
setValue
Sets the value of this attribute. This method assumes that theFeature.setPropertyValue(String, Object)implementation will verify the argument type.- Overrides:
setValuein classAttributeView<V>- Parameters:
value- the new value, ornullfor removing all values from this attribute.- See Also:
-
getValues
Wraps the property value in a set.- Overrides:
getValuesin classAttributeView<V>- Returns:
- the attribute values in a live collection.
-