|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectRecordTypeImpl
public class RecordTypeImpl
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 "MemberName
s"
and are usually defined in the context of a schema.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.attributeTypes
- Method Detail |
---|
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 RecordType
public RecordSchema getContainer()
getContainer
in interface RecordType
public Map<MemberName,TypeName> getAttributeTypes()
getAttributeTypes
in interface RecordType
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 RecordType
public TypeName locate(MemberName memberName)
null
. This method
is functionnaly equivalent to
getAttributeTypes().get(name)
.
locate
in interface RecordType
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 RecordType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |