@UML(identifier="RecordType", specification=ISO_19103) public interface RecordType extends Type
RecordType defines dynamically
constructed data type. This interface has methods for data access, but no methods to dynamically
add members. This approach ensures that once a RecordType is constructed, it is immutable.
A RecordType is identified by a TypeName. It contains
an arbitrary amount of member types. A RecordType may
therefore contain another RecordType as a member.
This class can be think as the equivalent of the Java Class class.
Record,
RecordSchema| Modifier and Type | Method and Description |
|---|---|
RecordSchema |
getContainer()
Returns the schema that contains this record type.
|
Set<MemberName> |
getMembers()
Returns the set of member names defined in this
RecordType's dictionary. |
Map<MemberName,Type> |
getMemberTypes()
Returns the dictionary of all (name, type) pairs in this record type.
|
TypeName |
getTypeName()
Returns the name that identifies this record type.
|
boolean |
isInstance(Record record)
Determines if the specified record is compatible with this record type.
|
TypeName |
locate(MemberName name)
Looks up the provided attribute name and returns the associated type name.
|
@UML(identifier="typeName", obligation=MANDATORY, specification=ISO_19103) TypeName getTypeName()
RecordType is contained in a record schema,
then the record type name shall be a valid in the name space
of the record schema:
getContainer().getSchemaName().scope()
This method can be think as the equivalent of the Java Class.getName() method.getTypeName in interface TypeRecordSchema getContainer()
Departure from OGC/ISO specification:
This is theTypeListassociation in figure 15 of ISO 19103:2005, but navigable in the opposite way. The navigation in the ISO way is represented by theRecordSchema.getDescription().values().
@UML(identifier="memberTypes", obligation=MANDATORY, specification=ISO_19103) Map<MemberName,Type> getMemberTypes()
The name space associated with a RecordType contains only
members of this RecordType. There is no potential for conflict with sub-packages.
This method can be think as the equivalent of the Java Class.getFields() method.
Record.getAttributes()Set<MemberName> getMembers()
RecordType's dictionary.
If there are no members, this method returns the empty set. This method is functionally
equivalent to getMemberTypes().keySet().
The name space associated with a RecordType contains only
members of this RecordType. There is no potential for conflict with sub-packages.
This method can be think as the equivalent of the Java Class.getFields() method.
RecordType's dictionary.Departure from OGC/ISO specification:
This method provides no additional information compared to the ISO standard methods, but is declared in GeoAPI as a convenient shortcut.
@UML(identifier="locate", obligation=MANDATORY, specification=ISO_19103) TypeName locate(MemberName name)
null. This method is functionally
equivalent to getMemberTypes().get(name).getTypeName().
This method can be think as the equivalent of the Java Class.getField(String) method.
name - The name of the attribute we are looking for.null.Record.locate(MemberName)boolean isInstance(Record record)
true if the specified record argument is non-null and the following condition
holds:
getMembers().containsAll(record.getAttributes().keySet())
This method can be think as the equivalent of the Java Class.isInstance(Object) method.
record - The record to test for compatibility.true if the given record is compatible with this record type.Departure from OGC/ISO specification:
This method provides no additional information compared to the ISO standard methods, but is declared in GeoAPI as a convenient shortcut.
Copyright © 1994–2017 Open Geospatial Consortium. All rights reserved.