Interface AttributeType<V>
-
- Type Parameters:
V- the type of attribute values.
- All Superinterfaces:
IdentifiedType,PropertyType
- All Known Subinterfaces:
DynamicAttributeType<V>
@Classifier(METACLASS) @UML(identifier="AttributeType", specification=ISO_19109) public interface AttributeType<V> extends PropertyType
Definition of an attribute in a feature type. The name of attribute type is mandatory. The name scope is typically the name of the feature type containing this attribute, but this is not mandatory. The scope could also be defined by the ontology for example.Note: Compared to the Java language,AttributeTypeis equivalent toFieldwhileFeatureTypeis equivalent toClass.Value type
Attributes can be used for both spatial and non-spatial properties. Some examples are:Attribute value type examples Attribute name Value type Building shape GeometryBuilding owner ResponsibilityHorizontal accuracy PositionalAccuracyAttribute characterization
AnAttributecan be characterized by other attributes. For example an attribute that carries a measurement (e.g. air temperature) may have another attribute that holds the measurement accuracy (e.g. ±0.1°C). Such accuracy can be stored as a characteristic of the measurement attribute.The
characteristics()method in thisAttributeTypeinterface returns a description of all characteristics that attributes of this type may have. The actual characteristics values can be stored on a record-by-record basis in theAttribute.characteristics()map. However in the common case of characteristics having a constant value for all records in a dataset, the constant can be given by the characteristic default value andAttribute.characteristics()may return an empty map (at implementation choice).- Since:
- 3.1
- See Also:
Attribute,DynamicAttributeType
-
-
Method Summary
Modifier and Type Method Description default Map<String,AttributeType<?>>characteristics()Other attribute types that describes this attribute type.VgetDefaultValue()Returns the default value for the attribute.intgetMaximumOccurs()Returns the maximum number of attribute values.intgetMinimumOccurs()Returns the minimum number of attribute values.GenericNamegetName()Returns the name of this attribute type.Class<V>getValueClass()Returns the type of attribute values.Attribute<V>newInstance()Creates a new attribute instance of this type initialized to the default value.-
Methods inherited from interface IdentifiedType
getDefinition, getDescription, getDesignation
-
-
-
-
Method Detail
-
getName
@UML(identifier="name", obligation=MANDATORY, specification=ISO_19109) GenericName getName()
Returns the name of this attribute type. ForAttributeType, the name is mandatory.- Specified by:
getNamein interfaceIdentifiedType- Returns:
- the attribute type name.
-
getValueClass
@UML(identifier="valueType", obligation=MANDATORY, specification=ISO_19109) Class<V> getValueClass()
Returns the type of attribute values.- Returns:
- the type of attribute values.
-
getMinimumOccurs
@UML(identifier="cardinality", obligation=MANDATORY, specification=ISO_19109) int getMinimumOccurs()
Returns the minimum number of attribute values. The returned value is greater than or equal to zero.To be valid, an
Attributeinstance of thisAttributeTypeshall have at least this minimum number of elements in itscollection of values.- Returns:
- the minimum number of attribute values.
-
getMaximumOccurs
@UML(identifier="cardinality", obligation=MANDATORY, specification=ISO_19109) int getMaximumOccurs()
Returns the maximum number of attribute values. The returned value is greater than or equal to thegetMinimumOccurs()value. If there is no maximum, then this method returnsInteger.MAX_VALUE.To be valid, an
Attributeinstance of thisAttributeTypeshall have no more than this maximum number of elements in itscollection of values.- Returns:
- the maximum number of attribute values, or
Integer.MAX_VALUEif none.
-
getDefaultValue
V getDefaultValue()
Returns the default value for the attribute. This value is used when an attribute is created and no value for it is specified.- Returns:
- the default value for the attribute, or
nullif none.
-
characteristics
@UML(identifier="characterizeBy", obligation=OPTIONAL, specification=ISO_19109) default Map<String,AttributeType<?>> characteristics()
Other attribute types that describes this attribute type. See "Attribute characterization" in class Javadoc for more information.Example: An attribute that carries a measurement (e.g. air temperature) may have another attribute that holds the measurement accuracy.The characteristics are enumerated in the map values. The map keys are theStringrepresentations of characteristics name, for more convenient lookups.- Returns:
- other attribute types that describes this attribute type, or an empty map if none.
- See Also:
Attribute.characteristics()
-
newInstance
Attribute<V> newInstance() throws UnsupportedOperationException
Creates a new attribute instance of this type initialized to the default value.- Returns:
- a new attribute instance.
- Throws:
UnsupportedOperationException- if this type does not support new instance creation.
-
-