public class Heading
extends java.lang.Object
implements java.io.Externalizable
Constructor and Description |
---|
Heading()
Deprecated.
- constructor is defined exclusively for the Externalizable() machinery.
|
Heading(java.util.Map<NameIdentifier,TypeDeclaration> attributesMapping,
boolean dummy)
Creates the Heading
|
Heading(java.util.Map<java.lang.String,TypeDeclaration> attributesMapping)
Deprecated.
- replace with the constructor that takes a Map with NameIdentifiers as keys
|
Modifier and Type | Method and Description |
---|---|
static Heading |
computeIntersectionHeading(Heading thisHeading,
Heading otherHeading)
Gets the heading of the result when intersecting this relation type with the given relation type.
|
static Heading |
computeJoinHeading(Heading thisHeading,
Heading otherHeading)
Gets The Heading of the relation that is the result of joining a relation of this heading type with a relation of the given one
|
boolean |
containsAttribute(NameIdentifier attributeName)
Checks whether an attribute of the given name appears in the heading
|
boolean |
containsAttribute(java.lang.String attributeName)
Deprecated.
- replace with the method that takes a NameIdentifier as argument
|
boolean |
equals(java.lang.Object obj)
Two headings are equal if and only if they represent the same attribute to type mappings
|
boolean |
equalsHeading(Heading obj)
Compares this heading for equality with an other one.
|
MyReadOnlySet<NameIdentifier> |
getAllIntervalTypedAttributeNameIdentifiers()
Gets the set of names of attributes in this heading that are interval-typed.
|
java.util.LinkedList<NameIdentifier> |
getAllIntervalTypedAttributeNameIdentifiersList()
Gets the in-lexicographical-order list of names of attributes in this heading that are interval-typed.
|
MyReadOnlySet<java.lang.String> |
getAllIntervalTypedAttributeNames()
Deprecated.
- replace with the method that returns a set of NameIdentifiers
|
java.util.LinkedList<java.lang.String> |
getAllIntervalTypedAttributeNamesList()
Deprecated.
- replace with
getAllIntervalTypedAttributeNameIdentifiersList() |
MyReadOnlySet<NameIdentifier> |
getAllNonIntervalTypedAttributeNameIdentifiers()
Gets the set of names of attributes in this heading that are not interval-typed.
|
MyReadOnlySet<java.lang.String> |
getAllNonIntervalTypedAttributeNames()
Deprecated.
- replace with
getAllIntervalTypedAttributeNameIdentifiers() |
MyReadOnlyMap<NameIdentifier,TypeDeclaration> |
getAttributeIdentifiersMapping()
Gets The mapping defining the attributes that are part of the Heading and their corresponding types
|
MyReadOnlySet<NameIdentifier> |
getAttributeNameIdentifiers()
Gets The set of attribute names
|
MyReadOnlySet<java.lang.String> |
getAttributeNames()
Deprecated.
- replace with the method that returns NameIdentifier sets
|
MyReadOnlyMap<java.lang.String,TypeDeclaration> |
getAttributesMapping()
Deprecated.
- replace with
getAttributeIdentifiersMapping() |
Heading |
getCommonSubTypesHHeading(Heading h2)
Gets a heading that has the same attribute names as this heading h2, but where each type declaration is the least specific subtype of the types of that attribute in this heading and h2, respectively.
|
static Heading |
getCommonSubTypesHHeading(Heading h1,
Heading h2)
Gets a heading that has the same attribute names as heading 1 and 2, but where each type declaration is the least specific subtype of the types of that attribute in headings 1 and 2, respectively.
|
static java.util.Map<NameIdentifier,TypeDeclaration> |
getCommonSuperTypesHeading(Heading h1,
Heading h2)
Deprecated.
- replace with getCommonSuperTypesHHeading, which returns a Heading object instead of requiring the user to create one himself
|
Heading |
getCommonSuperTypesHHeading(Heading h2)
Gets a heading that has the same attribute names as heading 1 and 2, but where each type declaration is the most specific supertype of the types of that attribute in headings 1 and 2, respectively.
|
static Heading |
getCommonSuperTypesHHeading(Heading h1,
Heading h2)
Gets a heading that has the same attribute names as heading 1 and 2, but where each type declaration is the most specific supertype of the types of that attribute in headings 1 and 2, respectively.
|
int |
getDegree()
Gets the degree of the Heading
|
java.util.Set<java.util.Map.Entry<java.lang.String,TypeDeclaration>> |
getEntries()
Deprecated.
- replace with
getEntriesWithIdentifier() |
java.util.Set<java.util.Map.Entry<NameIdentifier,TypeDeclaration>> |
getEntriesWithIdentifier()
Gets the set of Map Entries of this Heading's attributeName-to-TypeDeclaration mapping
|
Heading |
getHeading(NameIdentifier attributeName)
Gets the heading object defining the nonscalar (relation/tuple) type of the named attribute, or null if the attribute is scalar
|
Heading |
getHeading(java.lang.String attributeName)
Deprecated.
- replace with the method that takes a NameIdentifier as argument
|
TypeDeclaration |
getTypeDeclaration(NameIdentifier attributeName)
Gets the TypeDeclaration object corresponding to the named attribute.
|
TypeDeclaration |
getTypeDeclaration(java.lang.String attributeName)
Deprecated.
deprecated
|
java.util.Collection<TypeDeclaration> |
getTypeDeclarations()
Gets The set of attribute names
|
TypeDeclaration |
getTypeDeclarationWithoutException(NameIdentifier attributeName)
Gets the TypeDeclaration object corresponding to the named attribute.
|
TypeDeclaration |
getTypeDeclarationWithoutException(java.lang.String attributeName)
Deprecated.
- replace with the method that takes a NameIdentifier as argument
|
NameIdentifier |
getTypeName(NameIdentifier attributeName)
Gets the typename of the named attribute.
|
java.lang.String |
getTypeName(java.lang.String attributeName)
Deprecated.
- replace with
getTypeName(NameIdentifier) |
int |
hashCode() |
boolean |
hasIntervals()
Gets the intervaltypes indicator
|
boolean |
isNonScalarSubTypeOf(Heading heading)
Checks whether this heading represents/defines a nonscalar subtype of the given one.
|
boolean |
isStrictUnionCompatibleWith(Heading other)
Checks if the heading of another Relvar is exactly the same as this one :
The set of attribute names in the other heading is equal to the set of attribute names in this heading
The Type associated with each attribute name is the same in both headings
|
java.lang.String |
print()
Gets the heading specification in textual format HEADING(ATTRIBUTENAME(TYPENAME)RELATIONTYPEDATTRIBUTENAME(RELATION(HEADING(...))))
|
java.lang.String |
printXML()
Gets the heading specification in XML style
|
void |
readExternal(java.io.ObjectInput in) |
Heading |
subHeadingExcluding(java.util.Collection<NameIdentifier> attributeNames,
boolean dummy)
Gets a Heading that includes only the attribute definitions from this Heading whose attribute names do not appear in the given set
|
Heading |
subHeadingExcluding(java.util.Collection<java.lang.String> attributeNames)
Deprecated.
- replace with
subHeadingExcluding(Collection, boolean) |
Heading |
subHeadingIncluding(java.util.Set<NameIdentifier> attributeNames,
boolean dummy)
Gets a Heading that includes only the attribute definitions from this Heading whose attribute names appear in the given set
|
Heading |
subHeadingIncluding(java.util.Set<java.lang.String> attributeNames)
Deprecated.
- replace with
subHeadingIncluding(Set, boolean) |
void |
toStream1_0(java.io.DataOutputStream outputStream)
Writes the heading to an outputstream in the V1.0 format
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
@Deprecated public Heading()
public Heading(java.util.Map<NameIdentifier,TypeDeclaration> attributesMapping, boolean dummy)
attributesMapping
- The mapping defining the attributes that are part of the Heading and their corresponding typesdummy
- unused extra parameter because there is no other way in java to distinguish constructors both using a Map argument that differs only in the generics portion@Deprecated public Heading(java.util.Map<java.lang.String,TypeDeclaration> attributesMapping)
attributesMapping
- The mapping defining the attributes that are part of the Heading and their corresponding typespublic static Heading computeIntersectionHeading(Heading thisHeading, Heading otherHeading) throws NotFoundException
thisHeading
- the heading of a relation involved in an intersectionotherHeading
- the Heading of another Relation involved in an intersectionNotFoundException
- If the set of attribute names in both headings are not equal, or no common supertype exists for the two types corresponding to the same attribute namepublic static Heading computeJoinHeading(Heading thisHeading, Heading otherHeading) throws NotFoundException
thisHeading
- The heading of a relation involved in a joinotherHeading
- The heading of another relation involved in a joinNotFoundException
- if no common type can be found for attributes of the same name, that are declared to be of different types in both headings involvedpublic static Heading getCommonSubTypesHHeading(Heading h1, Heading h2) throws NotFoundException
h1
- heading 1h2
- heading 2NotFoundException
- if no such heading exists. This is the case if the attribute name sets differ, or if some attribute in the headings has respective types that do not have a common subtype.@Deprecated public static java.util.Map<NameIdentifier,TypeDeclaration> getCommonSuperTypesHeading(Heading h1, Heading h2) throws NotFoundException
h1
- heading 1h2
- heading 2NotFoundException
- if no such heading exists. This is the case if the attribute name sets differ, or if some attribute in the headings has respective types that do not have a common supertype.public static Heading getCommonSuperTypesHHeading(Heading h1, Heading h2) throws NotFoundException
h1
- heading 1h2
- heading 2NotFoundException
- if no such heading exists. This is the case if the attribute name sets differ, or if some attribute in the headings has respective types that do not have a common supertype.public final boolean containsAttribute(NameIdentifier attributeName)
attributeName
- the attribute name to check@Deprecated public final boolean containsAttribute(java.lang.String attributeName)
attributeName
- the attribute name to checkpublic final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final boolean equalsHeading(Heading obj)
obj
- the Heading to compare this one with.public final MyReadOnlySet<NameIdentifier> getAllIntervalTypedAttributeNameIdentifiers()
public final java.util.LinkedList<NameIdentifier> getAllIntervalTypedAttributeNameIdentifiersList()
@Deprecated public final MyReadOnlySet<java.lang.String> getAllIntervalTypedAttributeNames()
@Deprecated public final java.util.LinkedList<java.lang.String> getAllIntervalTypedAttributeNamesList()
getAllIntervalTypedAttributeNameIdentifiersList()
public final MyReadOnlySet<NameIdentifier> getAllNonIntervalTypedAttributeNameIdentifiers()
@Deprecated public final MyReadOnlySet<java.lang.String> getAllNonIntervalTypedAttributeNames()
getAllIntervalTypedAttributeNameIdentifiers()
public final MyReadOnlyMap<NameIdentifier,TypeDeclaration> getAttributeIdentifiersMapping()
public final MyReadOnlySet<NameIdentifier> getAttributeNameIdentifiers()
@Deprecated public final MyReadOnlySet<java.lang.String> getAttributeNames()
@Deprecated public final MyReadOnlyMap<java.lang.String,TypeDeclaration> getAttributesMapping()
getAttributeIdentifiersMapping()
public Heading getCommonSubTypesHHeading(Heading h2) throws NotFoundException
h2
- heading 2NotFoundException
- if no such heading exists. This is the case if the attribute name sets differ, or if some attribute in the headings has respective types that do not have a common subtype.public Heading getCommonSuperTypesHHeading(Heading h2) throws NotFoundException
h2
- heading 2NotFoundException
- if no such heading exists. This is the case if the attribute name sets differ, or if some attribute in the headings has respective types that do not have a common supertype.public final int getDegree()
@Deprecated public final java.util.Set<java.util.Map.Entry<java.lang.String,TypeDeclaration>> getEntries()
getEntriesWithIdentifier()
public final java.util.Set<java.util.Map.Entry<NameIdentifier,TypeDeclaration>> getEntriesWithIdentifier()
public final Heading getHeading(NameIdentifier attributeName)
attributeName
- The name of a relation-typed attribute whose heading is to be obtained@Deprecated public final Heading getHeading(java.lang.String attributeName)
attributeName
- The name of a relation-typed attribute whose heading is to be obtainedpublic final TypeDeclaration getTypeDeclaration(NameIdentifier attributeName) throws NotFoundException
attributeName
- The name of the attribute whose type name is to be obtainedNotFoundException
- If the heading does not contain the named attribute@Deprecated public final TypeDeclaration getTypeDeclaration(java.lang.String attributeName) throws NotFoundException
attributeName
- The name of the attribute whose type name is to be obtainedNotFoundException
- If the heading does not contain the named attributepublic final java.util.Collection<TypeDeclaration> getTypeDeclarations()
public final TypeDeclaration getTypeDeclarationWithoutException(NameIdentifier attributeName)
attributeName
- The name of the attribute whose type name is to be obtained@Deprecated public final TypeDeclaration getTypeDeclarationWithoutException(java.lang.String attributeName)
attributeName
- The name of the attribute whose type name is to be obtainedpublic final NameIdentifier getTypeName(NameIdentifier attributeName)
attributeName
- The name of the attribute whose type name is to be obtained@Deprecated public final java.lang.String getTypeName(java.lang.String attributeName)
getTypeName(NameIdentifier)
attributeName
- The name of the attribute whose type name is to be obtainedpublic final int hashCode()
hashCode
in class java.lang.Object
public final boolean hasIntervals()
public boolean isNonScalarSubTypeOf(Heading heading)
heading
- A Heading to compare this one to for "subtype-ness".public final boolean isStrictUnionCompatibleWith(Heading other)
other
- the Heading of another Relvarpublic final java.lang.String print()
public final java.lang.String printXML()
public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public final Heading subHeadingExcluding(java.util.Collection<NameIdentifier> attributeNames, boolean dummy)
attributeNames
- The names of the attributes that are not to appear in the subHeadingdummy
- unused parameter because java has no way to distinguish method signatures by generics@Deprecated public final Heading subHeadingExcluding(java.util.Collection<java.lang.String> attributeNames)
subHeadingExcluding(Collection, boolean)
attributeNames
- The names of the attributes that are not to appear in the subHeadingpublic final Heading subHeadingIncluding(java.util.Set<NameIdentifier> attributeNames, boolean dummy)
attributeNames
- The names of the attributes that are to appear in the subHeadingdummy
- unused parameter because java has no way to distinguish method signatures by generics@Deprecated public final Heading subHeadingIncluding(java.util.Set<java.lang.String> attributeNames)
subHeadingIncluding(Set, boolean)
attributeNames
- The names of the attributes that are to appear in the subHeadingpublic final void toStream1_0(java.io.DataOutputStream outputStream) throws java.io.IOException
outputStream
- the outputstream to write the heading tojava.io.IOException
- -public final java.lang.String toString()
toString
in class java.lang.Object
public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException