All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DSRG.MKB.Attribute

java.lang.Object
   |
   +----DSRG.MKB.Attribute

public class Attribute
extends Object
represents an attribute in some relation.
This is meta-knowledge, so the attribute knows only its name, type, and some performance parameters for the QC-Model (size).


Variable Index

 o attName
the name of this attribute
 o attSize
this is the WIDTH of the column, to go with the type.
 o attType
the type of this attribute (as a String)
 o parent
my parent relation object

Constructor Index

 o Attribute(Relation, String, int)
Construct an Attribute Object.
 o Attribute(Relation, String, String, int)
These should eventually be the only remaining constructors.

Method Index

 o changeName(String)
renames attribute in MKB only
 o displayAll()
returns a string representation of this attribute
 o getFullName()
get name in the form "ISName.RelName.AttName"
 o getIS()
returns the IS object that is this attribute's parent relation's IS
 o getName()
get name.
 o getNoIS()
Return Attribute Name in the form RelName.AttName.
 o getRelation()
return the relation object that is this attribute's parent
 o getSize()
return size (which is just a number passed in the constructor) of this attribute
 o getType()
return attribute's type as String
 o getTypeConstraint()
return a TypeConstraint Object.
 o getTypeConstraintAsString()
return a string of the form "attType(attName)".
 o setSize(int)
set size of this attribute
 o setType(String)
set attribute's type as String
 o toString()
Dump the Attribute Object.

Variables

 o attName
 private String attName
the name of this attribute

 o attType
 private String attType
the type of this attribute (as a String)

 o attSize
 private int attSize
this is the WIDTH of the column, to go with the type. It is not the number of tuples in the attribute. Currently (051999) this is mixed with the physical size of the attribute that we need for QC-computation. We should sort it out later since the logical size could be different from the stored size :(

 o parent
 private Relation parent
my parent relation object

Constructors

 o Attribute
 public Attribute(Relation rel,
                  String name,
                  int size)
Construct an Attribute Object. Called from parser. With "size" parameter for QC purpose. The "type" is not assigned here since this would have made the MKBParser too complicated (since Type Constraints are defined later than attributes).

 o Attribute
 public Attribute(Relation myRel,
                  String myName,
                  String myType,
                  int mySize)
These should eventually be the only remaining constructors. One assumes that the attribute has the relation name of its parent, the other allows to overwrite the table name (for query breakdown)

Methods

 o displayAll
 public String displayAll()
returns a string representation of this attribute

 o toString
 public String toString()
Dump the Attribute Object.

Overrides:
toString in class Object
 o getTypeConstraintAsString
 public String getTypeConstraintAsString()
return a string of the form "attType(attName)". For user interfaces.

 o getTypeConstraint
 public TypeConstraint getTypeConstraint()
return a TypeConstraint Object. Used for user interface

 o getName
 public String getName()
get name.

 o getFullName
 public String getFullName()
get name in the form "ISName.RelName.AttName"

 o getNoIS
 public String getNoIS()
Return Attribute Name in the form RelName.AttName. Function should be renamed - the name is misleading

 o getType
 public String getType()
return attribute's type as String

 o setType
 public void setType(String myType)
set attribute's type as String

 o getSize
 public int getSize()
return size (which is just a number passed in the constructor) of this attribute

 o setSize
 public void setSize(int newSize)
set size of this attribute

 o getRelation
 public Relation getRelation()
return the relation object that is this attribute's parent

 o getIS
 public IS getIS()
returns the IS object that is this attribute's parent relation's IS

 o changeName
 public boolean changeName(String newName)
renames attribute in MKB only


All Packages  Class Hierarchy  This Package  Previous  Next  Index