org.geotools.util
Class RecordTypeImpl

java.lang.Object
  extended by org.geotools.util.RecordTypeImpl
All Implemented Interfaces:
org.opengis.util.RecordType

public class RecordTypeImpl
extends java.lang.Object
implements org.opengis.util.RecordType

The type definition of a record. Used to provide a record of data type (in a manner similar to a strongly typed Map).

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.

Since:
2.4
Version:
$Id: RecordTypeImpl.java 31557 2008-09-19 20:02:35Z desruisseaux $
Author:
Jody Garnet, Martin Desruisseaux

Constructor Summary
RecordTypeImpl(org.opengis.util.RecordSchema parent, org.opengis.util.TypeName typeName, java.util.Collection<org.opengis.util.MemberName> members)
          Creates a record with all attribute types specified.
RecordTypeImpl(org.opengis.util.RecordSchema parent, org.opengis.util.TypeName typeName, java.util.Map<org.opengis.util.MemberName,org.opengis.util.TypeName> attributeTypes)
          Creates a record with all attribute types specified.
 
Method Summary
 java.util.Map<org.opengis.util.MemberName,org.opengis.util.TypeName> getAttributeTypes()
          Returns the unmodifiable dictionary of all (name, type) pairs in this record type.
 org.opengis.util.RecordSchema getContainer()
          Returns the schema that contains this record type.
 java.util.Set<org.opengis.util.MemberName> getMembers()
          Returns the set of attribute names defined in this RecordType's dictionary.
 org.opengis.util.TypeName getTypeName()
          Returns the name that identifies this record type.
 boolean isInstance(org.opengis.util.Record record)
          Determines if the specified record is compatible with this record type.
 org.opengis.util.TypeName locate(org.opengis.util.MemberName memberName)
          Looks up the provided attribute name and returns the associated type name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordTypeImpl

public RecordTypeImpl(org.opengis.util.RecordSchema parent,
                      org.opengis.util.TypeName typeName,
                      java.util.Collection<org.opengis.util.MemberName> members)
Creates a record with all attribute types specified.

Parameters:
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.

RecordTypeImpl

public RecordTypeImpl(org.opengis.util.RecordSchema parent,
                      org.opengis.util.TypeName typeName,
                      java.util.Map<org.opengis.util.MemberName,org.opengis.util.TypeName> attributeTypes)
Creates a record with all attribute types specified.

Parameters:
parent - The schema that contains this record type.
typeName - The name that identifies this record type.
attributeTypes -
Method Detail

getTypeName

public org.opengis.util.TypeName getTypeName()
Returns the name that identifies this record type. If this 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()

Specified by:
getTypeName in interface org.opengis.util.RecordType

getContainer

public org.opengis.util.RecordSchema getContainer()
Returns the schema that contains this record type.

Specified by:
getContainer in interface org.opengis.util.RecordType

getAttributeTypes

public java.util.Map<org.opengis.util.MemberName,org.opengis.util.TypeName> getAttributeTypes()
Returns the unmodifiable dictionary of all (name, type) pairs in this record type.

Specified by:
getAttributeTypes in interface org.opengis.util.RecordType

getMembers

public java.util.Set<org.opengis.util.MemberName> getMembers()
Returns the set of attribute names defined in this RecordType's dictionary. If there are no attributes, this method returns the empty set. This method is functionally equivalent to getAttributeTypes().keySet().

Specified by:
getMembers in interface org.opengis.util.RecordType

locate

public org.opengis.util.TypeName locate(org.opengis.util.MemberName memberName)
Looks up the provided attribute name and returns the associated type name. If the attribute name is not defined in this record type, then this method returns null. This method is functionnaly equivalent to getAttributeTypes().get(name).

Specified by:
locate in interface org.opengis.util.RecordType

isInstance

public boolean isInstance(org.opengis.util.Record record)
Determines if the specified record is compatible with this record type. This method returns true if the specified record argument is non-null and the following condition holds:

Specified by:
isInstance in interface org.opengis.util.RecordType


Copyright © 1996-2010 Geotools. All Rights Reserved.