- 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 Superinterfaces:
IdentifiedType
,PropertyType
- All Known Subinterfaces:
DynamicAttributeType<V>
AttributeType
is equivalent to Field
while FeatureType
is equivalent to Class
.Value type
Attributes can be used for both spatial and non-spatial properties. Some examples are:Attribute name | Value type |
---|---|
Building shape | Geometry |
Building owner | Responsibility |
Horizontal accuracy | PositionalAccuracy |
Attribute characterization
AnAttribute
can 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 this AttributeType
interface 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 the Attribute.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 and
Attribute.characteristics()
may return an empty map (at implementation choice).
- Since:
- 3.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Map<String,
AttributeType<?>> Other attribute types that describe this attribute type.Returns the default value for the attribute.int
Returns the maximum number of attribute values.int
Returns the minimum number of attribute values.getName()
Returns the name of this attribute type.Returns the type of attribute values.Creates a new attribute instance of this type initialized to the default value.Methods inherited from interface IdentifiedType
getDefinition, getDescription, getDesignation
-
Method Details
-
getName
Returns the name of this attribute type. ForAttributeType
, the name is mandatory.- Specified by:
getName
in 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
Attribute
instance of thisAttributeType
shall 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
Attribute
instance of thisAttributeType
shall have no more than this maximum number of elements in itscollection of values
.- Returns:
- the maximum number of attribute values, or
Integer.MAX_VALUE
if 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
null
if none.
-
characteristics
@UML(identifier="characterizeBy", obligation=OPTIONAL, specification=ISO_19109) default Map<String,AttributeType<?>> characteristics()Other attribute types that describe 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 theString
representations of characteristics name, for more convenient lookups.- Returns:
- other attribute types that describe this attribute type, or an empty map if none.
- See Also:
-
newInstance
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.
-