All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DSRG.MKB.MKB

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

public class MKB
extends Object
implements Serializable
this is the Meta Knowledge Base main class. It hold lists of ISs, JCs and PCs as well as derived PCs and maintains the MKB under schema changes.


Variable Index

 o DEBUG
 o DerivedPC
 o IS_List
 o JC_List
 o LC_List
 o localIS
 o mainVSA
we need a handle to the VSA to notify it of schema changes, too.
 o PC_List

Constructor Index

 o MKB()
A default constructor to create an empty MKB object.
 o MKB(String)
Constructor uses the New MKB Parser.

Method Index

 o addAttribute(String, String, String, String)
this adds an attribute as a schema change.
 o addIS(IS)
Add a new IS object to this MKB.
 o addJoinConstraint(JoinConstraint)
 o addLocalCondition(LocalCondition)
 o addPCConstraint(PCConstraint)
 o addRelation(String, String, Vector, Vector)
the actual capability change "addRelation".
 o changeAttributeName(String, String, String, String)
Change a specific Attribute name from "IS.R.A" to "IS.R.B".
 o changeRelationName(String, String, String)
 o deleteAttribute(String, String, String)
 o deleteAttribute_maintainMKB(Attribute)
 o deleteJoinConstraint(JoinConstraint)
 o deletePCConstraint(PCConstraint)
 o deleteRelation(String, String)
the MKB capability change "deleteRelation".
 o displayAll()
 o findAttribute(String, String, String)
return a specific attribute.
 o findIS(String)
 o findJC(String, String, String, String)
 o findPOC(Relation, Vector, int)
Find POC PC constraint Pi(upperline{B}(S)) phi Pi(upperline{A}(R))
 o findRelation(String, String)
 o getAllAttributesAsStrings(String, String)
 o getAllISsAsStrings()
 o getAllJcsForRelation(String, String)
 o getAllJcsForRelationAsStrings(String, String)
 o getAllPcsForRelation(String, String)
 o getAllPcsForRelationAsStrings(String, String)
 o getAllRelationsAsStrings(String)
 o getAllTcsForRelation(String, String)
 o getAllTcsForRelationAsStrings(String, String)
returns all TypeConstraint Objects in a String representation.
 o getAttributeSize(String, String, String)
returns the size of an attribute in bytes.
 o getAttributeSizeForRelation(String, String)
returns the sum of the the sizes of all attributes in a relation in bytes.
 o getISs()
returns a vector is IS-objects (that are already in the MKB)
 o getJoinSelectivity(String, String, String, String)
returns join selectivity ((R1 \join R2)/(R1 X R2)) for a pair of given relations (dummy values)
 o getLocalConditionSelectivity(String, String, String, String)
returns local selectivity for a certain local condition.
 o getLocalIS()
 o getRelationSize(String, String)
returns relation size (number of tuples) for a given relation Name (dummy values)
 o setLocalIS(IS)
 o setVSA(VSA)
 o toString()
Dump this MKB object.
 o update(MKB)
Update MKB Object by another MKB object.

Variables

 o DEBUG
 private static final boolean DEBUG
 o mainVSA
 private VSA mainVSA
we need a handle to the VSA to notify it of schema changes, too. (currently only need after delete-operations. This cannot be passed in the constructor since it is not known at construction time.

 o localIS
 private IS localIS
 o IS_List
 public Vector IS_List
 o JC_List
 public Vector JC_List
 o PC_List
 public Vector PC_List
 o LC_List
 public Vector LC_List
 o DerivedPC
 public Vector DerivedPC

Constructors

 o MKB
 public MKB()
A default constructor to create an empty MKB object. It used to let the MKB parser to fill it up!

 o MKB
 public MKB(String MKBFile)
Constructor uses the New MKB Parser.

Methods

 o update
 private void update(MKB mkb)
Update MKB Object by another MKB object.

 o displayAll
 public void displayAll()
 o setVSA
 public void setVSA(VSA myVSA)
 o getAllAttributesAsStrings
 public Vector getAllAttributesAsStrings(String isName,
                                         String relName)
 o getAllRelationsAsStrings
 public Vector getAllRelationsAsStrings(String isName)
 o getAllTcsForRelationAsStrings
 public Vector getAllTcsForRelationAsStrings(String isName,
                                             String relName)
returns all TypeConstraint Objects in a String representation. Used by user interfaces.

 o getAllTcsForRelation
 public Vector getAllTcsForRelation(String isName,
                                    String relName)
 o getAllJcsForRelationAsStrings
 public Vector getAllJcsForRelationAsStrings(String isName,
                                             String relName)
 o getAllJcsForRelation
 public Vector getAllJcsForRelation(String isName,
                                    String relName)
 o getAllPcsForRelationAsStrings
 public Vector getAllPcsForRelationAsStrings(String isName,
                                             String relName)
 o getAllPcsForRelation
 public Vector getAllPcsForRelation(String isName,
                                    String relName)
 o getAllISsAsStrings
 public Vector getAllISsAsStrings()
 o getISs
 public Vector getISs()
returns a vector is IS-objects (that are already in the MKB)

 o addIS
 public boolean addIS(IS newIS)
Add a new IS object to this MKB.

 o setLocalIS
 public void setLocalIS(IS anIS)
 o getLocalIS
 public IS getLocalIS()
 o addRelation
 public boolean addRelation(String ISName,
                            String RName,
                            Vector attList,
                            Vector typeList)
the actual capability change "addRelation". Only changes the MKB!

 o deleteRelation
 public boolean deleteRelation(String ISName,
                               String RName)
the MKB capability change "deleteRelation". Only changes the MKB!

 o changeRelationName
 public boolean changeRelationName(String isName,
                                   String relName,
                                   String newName)
 o addAttribute
 public boolean addAttribute(String ISName,
                             String RName,
                             String AttName,
                             String AttType)
this adds an attribute as a schema change. The size of the attribute is hardcoded and set to 37

 o deleteAttribute
 public boolean deleteAttribute(String ISName,
                                String RName,
                                String AttName)
 o deleteAttribute_maintainMKB
 private void deleteAttribute_maintainMKB(Attribute Att)
 o changeAttributeName
 public boolean changeAttributeName(String isName,
                                    String relName,
                                    String attName,
                                    String newName)
Change a specific Attribute name from "IS.R.A" to "IS.R.B".

Note: IS.R.B should not exist in the MKB already.

 o deletePCConstraint
 public boolean deletePCConstraint(PCConstraint thePC)
 o deleteJoinConstraint
 public boolean deleteJoinConstraint(JoinConstraint theJC)
 o findIS
 public IS findIS(String ISName)
 o findRelation
 public Relation findRelation(String ISName,
                              String RName)
 o addJoinConstraint
 public boolean addJoinConstraint(JoinConstraint theJC)
 o addPCConstraint
 public boolean addPCConstraint(PCConstraint thePC)
 o addLocalCondition
 public boolean addLocalCondition(LocalCondition theLC)
 o findAttribute
 public Attribute findAttribute(String ISName,
                                String RName,
                                String AttName)
return a specific attribute.

 o findJC
 public JoinConstraint findJC(String ISName1,
                              String RName1,
                              String ISName2,
                              String RName2)
 o findPOC
 public Vector findPOC(Relation rel,
                       Vector atleast,
                       int ve)
Find POC PC constraint Pi(upperline{B}(S)) phi Pi(upperline{A}(R))

Parameters:
rel - Relation R
atleast - subset of upperline{A}
ve - View Extent Parameter
Returns:
Vector of replacement.
 o toString
 public String toString()
Dump this MKB object.

Overrides:
toString in class Object
 o getRelationSize
 public long getRelationSize(String ISName,
                             String relationName)
returns relation size (number of tuples) for a given relation Name (dummy values)

Returns:
: -1 if relation Size is unknown
 o getJoinSelectivity
 public double getJoinSelectivity(String IS1,
                                  String relation1,
                                  String IS2,
                                  String relation2)
returns join selectivity ((R1 \join R2)/(R1 X R2)) for a pair of given relations (dummy values)

Returns:
-1.0 if JS unknown
 o getLocalConditionSelectivity
 public double getLocalConditionSelectivity(String IS,
                                            String relName,
                                            String attName,
                                            String value)
returns local selectivity for a certain local condition. -1 if local condition not found.

 o getAttributeSize
 public int getAttributeSize(String IS,
                             String relName,
                             String attName)
returns the size of an attribute in bytes.

Returns:
-1 if attribute size unknown
 o getAttributeSizeForRelation
 public int getAttributeSizeForRelation(String IS,
                                        String relName)
returns the sum of the the sizes of all attributes in a relation in bytes. Uses getAttributeSize(String, String, String)

Returns:
-1 if size of at least one attribute is unknown

All Packages  Class Hierarchy  This Package  Previous  Next  Index