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.
-
DEBUG
-
-
DerivedPC
-
-
IS_List
-
-
JC_List
-
-
LC_List
-
-
localIS
-
-
mainVSA
- we need a handle to the VSA to notify it of schema changes,
too.
-
PC_List
-
-
MKB()
- A default constructor to create an empty MKB object.
-
MKB(String)
- Constructor uses the New MKB Parser.
-
addAttribute(String, String, String, String)
- this adds an attribute as a schema change.
-
addIS(IS)
- Add a new IS object to this MKB.
-
addJoinConstraint(JoinConstraint)
-
-
addLocalCondition(LocalCondition)
-
-
addPCConstraint(PCConstraint)
-
-
addRelation(String, String, Vector, Vector)
-
the actual capability change "addRelation".
-
changeAttributeName(String, String, String, String)
- Change a specific Attribute name from "IS.R.A" to "IS.R.B".
-
changeRelationName(String, String, String)
-
-
deleteAttribute(String, String, String)
-
-
deleteAttribute_maintainMKB(Attribute)
-
-
deleteJoinConstraint(JoinConstraint)
-
-
deletePCConstraint(PCConstraint)
-
-
deleteRelation(String, String)
-
the MKB capability change "deleteRelation".
-
displayAll()
-
-
findAttribute(String, String, String)
- return a specific attribute.
-
findIS(String)
-
-
findJC(String, String, String, String)
-
-
findPOC(Relation, Vector, int)
- Find POC PC constraint Pi(upperline{B}(S)) phi Pi(upperline{A}(R))
-
findRelation(String, String)
-
-
getAllAttributesAsStrings(String, String)
-
-
getAllISsAsStrings()
-
-
getAllJcsForRelation(String, String)
-
-
getAllJcsForRelationAsStrings(String, String)
-
-
getAllPcsForRelation(String, String)
-
-
getAllPcsForRelationAsStrings(String, String)
-
-
getAllRelationsAsStrings(String)
-
-
getAllTcsForRelation(String, String)
-
-
getAllTcsForRelationAsStrings(String, String)
- returns all TypeConstraint Objects in a String
representation.
-
getAttributeSize(String, String, String)
- returns the size of an attribute in bytes.
-
getAttributeSizeForRelation(String, String)
- returns the sum of the the sizes of all attributes in a
relation in bytes.
-
getISs()
-
returns a vector is IS-objects (that are already in the MKB)
-
getJoinSelectivity(String, String, String, String)
- returns join selectivity ((R1 \join R2)/(R1 X R2)) for a pair
of given relations (dummy values)
-
getLocalConditionSelectivity(String, String, String, String)
- returns local selectivity for a certain local condition.
-
getLocalIS()
-
-
getRelationSize(String, String)
-
returns relation size (number of tuples) for a given relation
Name (dummy values)
-
setLocalIS(IS)
-
-
setVSA(VSA)
-
-
toString()
- Dump this MKB object.
-
update(MKB)
- Update MKB Object by another MKB object.
DEBUG
private static final boolean DEBUG
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.
localIS
private IS localIS
IS_List
public Vector IS_List
JC_List
public Vector JC_List
PC_List
public Vector PC_List
LC_List
public Vector LC_List
DerivedPC
public Vector DerivedPC
MKB
public MKB()
- A default constructor to create an empty MKB object.
It used to let the MKB parser to fill it up!
MKB
public MKB(String MKBFile)
- Constructor uses the New MKB Parser.
update
private void update(MKB mkb)
- Update MKB Object by another MKB object.
displayAll
public void displayAll()
setVSA
public void setVSA(VSA myVSA)
getAllAttributesAsStrings
public Vector getAllAttributesAsStrings(String isName,
String relName)
getAllRelationsAsStrings
public Vector getAllRelationsAsStrings(String isName)
getAllTcsForRelationAsStrings
public Vector getAllTcsForRelationAsStrings(String isName,
String relName)
- returns all TypeConstraint Objects in a String
representation. Used by user interfaces.
getAllTcsForRelation
public Vector getAllTcsForRelation(String isName,
String relName)
getAllJcsForRelationAsStrings
public Vector getAllJcsForRelationAsStrings(String isName,
String relName)
getAllJcsForRelation
public Vector getAllJcsForRelation(String isName,
String relName)
getAllPcsForRelationAsStrings
public Vector getAllPcsForRelationAsStrings(String isName,
String relName)
getAllPcsForRelation
public Vector getAllPcsForRelation(String isName,
String relName)
getAllISsAsStrings
public Vector getAllISsAsStrings()
getISs
public Vector getISs()
- returns a vector is IS-objects (that are already in the MKB)
addIS
public boolean addIS(IS newIS)
- Add a new IS object to this MKB.
setLocalIS
public void setLocalIS(IS anIS)
getLocalIS
public IS getLocalIS()
addRelation
public boolean addRelation(String ISName,
String RName,
Vector attList,
Vector typeList)
- the actual capability change "addRelation". Only changes the
MKB!
deleteRelation
public boolean deleteRelation(String ISName,
String RName)
- the MKB capability change "deleteRelation". Only changes the
MKB!
changeRelationName
public boolean changeRelationName(String isName,
String relName,
String newName)
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
deleteAttribute
public boolean deleteAttribute(String ISName,
String RName,
String AttName)
deleteAttribute_maintainMKB
private void deleteAttribute_maintainMKB(Attribute Att)
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.
deletePCConstraint
public boolean deletePCConstraint(PCConstraint thePC)
deleteJoinConstraint
public boolean deleteJoinConstraint(JoinConstraint theJC)
findIS
public IS findIS(String ISName)
findRelation
public Relation findRelation(String ISName,
String RName)
addJoinConstraint
public boolean addJoinConstraint(JoinConstraint theJC)
addPCConstraint
public boolean addPCConstraint(PCConstraint thePC)
addLocalCondition
public boolean addLocalCondition(LocalCondition theLC)
findAttribute
public Attribute findAttribute(String ISName,
String RName,
String AttName)
- return a specific attribute.
findJC
public JoinConstraint findJC(String ISName1,
String RName1,
String ISName2,
String RName2)
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.
toString
public String toString()
- Dump this MKB object.
- Overrides:
- toString in class Object
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
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
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.
getAttributeSize
public int getAttributeSize(String IS,
String relName,
String attName)
- returns the size of an attribute in bytes.
- Returns:
- -1 if attribute size unknown
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