public class RecordTypeImpl extends Object implements RecordType
Please note that a record is strongly typed (and may be better thought of as a
mathematical tuple). The "keys" are strictly controlled "MemberNames" and are usually
defined in the context of a schema.
| Constructor and Description |
|---|
RecordTypeImpl(RecordSchema parent,
TypeName typeName,
Collection<MemberName> members)
Creates a record with all attribute types specified.
|
RecordTypeImpl(RecordSchema parent,
TypeName typeName,
Map<MemberName,TypeName> attributeTypes)
Creates a record with all attribute types specified.
|
| Modifier and Type | Method and Description |
|---|---|
Map<MemberName,TypeName> |
getAttributeTypes()
Returns the unmodifiable dictionary of all (name, type) pairs in this
record type.
|
RecordSchema |
getContainer()
Returns the schema that contains this record type.
|
Set<MemberName> |
getMembers()
Returns the set of attribute names defined in this
RecordType's dictionary. |
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 memberName)
Looks up the provided attribute name and returns the associated type name.
|
public RecordTypeImpl(RecordSchema parent, TypeName typeName, Collection<MemberName> members)
parent - The schema that contains this record type.typeName - The name that identifies this record type.members - The name of the members to be included in this record type.public RecordTypeImpl(RecordSchema parent, TypeName typeName, Map<MemberName,TypeName> attributeTypes)
parent - The schema that contains this record type.typeName - The name that identifies this record type.public TypeName getTypeName()
RecordType is contained in
a record schema, then the record type name should be a valid in the
name space of the record schema:
getContainer().getSchemaName().scope()
getTypeName in interface RecordTypepublic RecordSchema getContainer()
getContainer in interface RecordTypepublic Map<MemberName,TypeName> getAttributeTypes()
getAttributeTypes in interface RecordTypeRecord.getAttributes()public Set<MemberName> getMembers()
RecordType's dictionary. If there
are no attributes, this method returns the empty set. This method is functionally equivalent
to getAttributeTypes().keySet().getMembers in interface RecordTypepublic TypeName locate(MemberName memberName)
null. This method
is functionnaly equivalent to
getAttributeTypes().get(name).locate in interface RecordTypeRecord.locate(org.opengis.util.MemberName)public boolean isInstance(Record record)
true if the specified record argument is non-null and the following condition
holds:
getMembers().containsAll(record.getAttributes().keySet())
isInstance in interface RecordTypeCopyright © 1996–2021 Geotools. All rights reserved.