DSRG.MKB
Class Relation

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

public class Relation
extends java.lang.Object

one relation (consists of attributes).
This is meta-data (MKB) only.


Field Summary
private  java.util.Vector attributes
          The attributes of this relation.
private  java.util.Vector joins
          the (references) to joins in which this relation takes part
(package private)  IS parent
          a reference to the parent IS object
private  java.util.Vector PCs
          the (references) to PCs in which this relation takes part
private  java.lang.String relName
          the logical name of this relation
private  int size
          Size of this relation ( number of tuples ).
 
Constructor Summary
Relation(IS myIS, java.lang.String myName, int size)
          Constructor used By MKBParser.
 
Method Summary
 boolean addAttribute(Attribute attr)
          Add an Attribute Object to this Relation.
 boolean addJoinConstraint(JoinConstraint theJC)
          add existing join constraint object to the join list of this attribute
 boolean addPCConstraint(PCConstraint thePC)
          add existing join constraint object to the join list of this attribute
(package private)  boolean changeRelationName(java.lang.String newName)
          renames MKB relation object only.
 boolean deleteAttribute(Attribute attr)
          Add an Attribute Object to this Relation.
 boolean deleteJoinConstraint(JoinConstraint theJC)
          remove join constraint from this attribute's list (only the reference, of course)
 boolean deletePCConstraint(PCConstraint thePC)
          remove PC constraint from this attribute's list (only the reference, of course)
 java.lang.String displayAll()
          gives a string representation of this Relation
private  void displayRel()
          function to be used for debugging purposes only
 Attribute findAttribute(java.lang.String Name)
          finds an attribute object by name
 java.util.Vector getAttributes()
          returns the vector of attributes in this relation
 java.lang.String getFullName()
          get a string of the form ISName.RelName
 IS getIS()
          return handle to this relation's IS
 java.lang.String getISName()
          return name of parent IS
 java.util.Vector getJCs()
          returns the vector of join constraints in this relation
 java.lang.String getName()
          returns the name of this relation
 java.util.Vector getPCs()
          returns the vector of PC constraints in this relation
 int getRelationSize()
          returns the number of tuples as stated in the MKB file (QC-Model system parameter)
 java.util.Vector getTCs()
          returns the vector of Type constraints in this relation.
private static java.lang.String pad(java.lang.String s, int length)
          a private function for output formatting.
 java.lang.String toString()
          Dump the Relation object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

relName

private java.lang.String relName
the logical name of this relation

parent

IS parent
a reference to the parent IS object

attributes

private java.util.Vector attributes
The attributes of this relation.
The elements are of type "EVEDemo.MKB.Attribute"

joins

private java.util.Vector joins
the (references) to joins in which this relation takes part

PCs

private java.util.Vector PCs
the (references) to PCs in which this relation takes part

size

private int size
Size of this relation ( number of tuples ). Used for QC model.
Constructor Detail

Relation

public Relation(IS myIS,
                java.lang.String myName,
                int size)
Constructor used By MKBParser. It has one more parameter: size (# of tuples)
Method Detail

displayAll

public java.lang.String displayAll()
gives a string representation of this Relation

toString

public java.lang.String toString()
Dump the Relation object.
Overrides:
toString in class java.lang.Object

getAttributes

public java.util.Vector getAttributes()
returns the vector of attributes in this relation

getJCs

public java.util.Vector getJCs()
returns the vector of join constraints in this relation

getPCs

public java.util.Vector getPCs()
returns the vector of PC constraints in this relation

getTCs

public java.util.Vector getTCs()
returns the vector of Type constraints in this relation.
Not sure if needed.

getRelationSize

public int getRelationSize()
returns the number of tuples as stated in the MKB file (QC-Model system parameter)

findAttribute

public Attribute findAttribute(java.lang.String Name)
finds an attribute object by name

addJoinConstraint

public boolean addJoinConstraint(JoinConstraint theJC)
add existing join constraint object to the join list of this attribute

deleteJoinConstraint

public boolean deleteJoinConstraint(JoinConstraint theJC)
remove join constraint from this attribute's list (only the reference, of course)

addPCConstraint

public boolean addPCConstraint(PCConstraint thePC)
add existing join constraint object to the join list of this attribute

deletePCConstraint

public boolean deletePCConstraint(PCConstraint thePC)
remove PC constraint from this attribute's list (only the reference, of course)

getName

public java.lang.String getName()
returns the name of this relation

getFullName

public java.lang.String getFullName()
get a string of the form ISName.RelName

getIS

public IS getIS()
return handle to this relation's IS

getISName

public java.lang.String getISName()
return name of parent IS

addAttribute

public boolean addAttribute(Attribute attr)
Add an Attribute Object to this Relation. Called from MKB Parser during system initialization.

deleteAttribute

public boolean deleteAttribute(Attribute attr)
Add an Attribute Object to this Relation. Called from MKB Parser during system initialization.

changeRelationName

boolean changeRelationName(java.lang.String newName)
renames MKB relation object only.

displayRel

private void displayRel()
function to be used for debugging purposes only

pad

private static java.lang.String pad(java.lang.String s,
                                    int length)
a private function for output formatting. Use only for debugging.