A list of logically related elements as (name, value) pairs in a
dictionary. A record may be used as an implementation representation for features.
This class can be think as the equivalent of the Java Object
class.
- Since:
- 2.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the dictionary of all (name, value) pairs in this record.Returns the type definition of record.locate
(MemberName name) Returns the value for an attribute of the specified name.void
set
(MemberName name, Object value) Sets the value for the attribute of the specified name.
-
Method Details
-
getRecordType
@UML(identifier="recordType", obligation=OPTIONAL, specification=ISO_19103) RecordType getRecordType()Returns the type definition of record. All attributes named in this record must be defined in the returned record type. In other words, the following relationship must holds:getRecordType().getMemberTypes().containsAll(getAttributes().keySet())
This method can be think as the equivalent of the Java
Object.getClass()
method.- Returns:
- The type definition of this record, or
null
.
-
getAttributes
@UML(identifier="memberValue", obligation=MANDATORY, specification=ISO_19103) Map<MemberName,Object> getAttributes()Returns the dictionary of all (name, value) pairs in this record. The returned map shall not allows key addition. It may allows the replacement of values for existing keys only.- Returns:
- The dictionary of all (name, value) pairs in this record.
- See Also:
- Departure from OGC/ISO abstract specification:
Generalization by relaxation of ISO/OGC restriction
Figure 15 in ISO 19103:2005 specifies a cardinality of 1. However, this seems to contradict the semantics of thelocate(name)
andRecordType.getMemberTypes()
methods.
-
locate
@UML(identifier="locate", obligation=MANDATORY, specification=ISO_19103) Object locate(MemberName name) Returns the value for an attribute of the specified name. This is functionally equivalent togetAttributes().get(name)
. The type of the returned object is given bygetRecordType().getMemberTypes().get(name)
.- Parameters:
name
- The name of the attribute to lookup.- Returns:
- The value of the attribute for the given name.
- See Also:
-
set
Sets the value for the attribute of the specified name. This is functionally equivalent togetAttributes().put(name,value)
. Remind thatname
keys are constrained to record type members only.- Parameters:
name
- The name of the attribute to modify.value
- The new value for the attribute.- Throws:
UnsupportedOperationException
- if this record is not modifiable.- Departure from OGC/ISO abstract specification:
Extension for convenience without introduction of new functionality
This method provides no additional functionality compared to the ISO standard methods, but is declared in GeoAPI as a convenient shortcut.
-