All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class DSRG.MW.Table

java.lang.Object
   |
   +----DSRG.MW.Table

public class Table
extends Object
this class holds a number of tuples together with a Relation object in the MKB to form a relation extent. It's used for holding relation extents, since those belong in the MKB.


Variable Index

 o attributeNames
the schema of the Table.
 o attributeSizes
the sizes of attribute in the attributes of the Table.
 o DEBUG
Debug flag
 o relName
the virtual name of this relation (for query breakdown)
 o tuples
a number of tuples in this extent

Constructor Index

 o Table()
a new constructor without argument...
 o Table(int)
constructs a relation extent object with a default size.
 o Table(Table)
a copy constructor used to copy the extent.

Method Index

 o addTuple(Tuple)
adds a tuple at the end of this vector.
 o getAttributeNames()
 o getAttributeSizes()
 o getRelName()
 o getSize()
returns the number of tuples in this relation.
 o getTuple(int)
gets the tuples at index i
 o getTuples()
return this Table's vector of tuples (the reference, not a clone)
 o removeTuple(Tuple, int)
searches for a certain tuple with the tuple's equals method and removes it from the extent.
 o setAttributeNames(Vector)
 o setAttributeSizes(Vector)
 o setRelName(String)
 o toString()
string representation (calls toString for all tuples, one line each).

Variables

 o DEBUG
 public static final boolean DEBUG
Debug flag

 o tuples
 private Vector tuples
a number of tuples in this extent

 o attributeNames
 private Vector attributeNames
the schema of the Table. A vector of Strings (attribute names)

 o attributeSizes
 private Vector attributeSizes
the sizes of attribute in the attributes of the Table. A vector of Integer (lengths)

 o relName
 private String relName
the virtual name of this relation (for query breakdown)

Constructors

 o Table
 public Table()
a new constructor without argument... trying to get rid of the peer object

 o Table
 public Table(int capacity)
constructs a relation extent object with a default size. This is good for efficiency (if the size of the relation to be stored is known)

 o Table
 public Table(Table oldTable)
a copy constructor used to copy the extent. Necessary for comparing old and new view extent in the EVE-Demo

Methods

 o getTuples
 public Vector getTuples()
return this Table's vector of tuples (the reference, not a clone)

 o getTuple
 public Tuple getTuple(int i)
gets the tuples at index i

Parameters:
i - the index of the tuple to be retrieved
Returns:
null if the index is invalid
 o getSize
 public int getSize()
returns the number of tuples in this relation.

Returns:
-1 if there are no tuples
 o addTuple
 public void addTuple(Tuple t)
adds a tuple at the end of this vector. If Vector is empty, creates a new vector with 10 original entries. Bag semantics.

 o removeTuple
 public int removeTuple(Tuple t,
                        int multiplicity)
searches for a certain tuple with the tuple's equals method and removes it from the extent. This is done multiplicity times.

Returns:
the actual number of removed tuples. If this is less than multiplicity of 0, then something is wrong
 o toString
 public String toString()
string representation (calls toString for all tuples, one line each).

Returns:
null if no tuples in the relation
Overrides:
toString in class Object
 o getRelName
 public String getRelName()
 o setRelName
 public void setRelName(String name)
 o getAttributeNames
 public Vector getAttributeNames()
 o setAttributeNames
 public void setAttributeNames(Vector attNames)
 o getAttributeSizes
 public Vector getAttributeSizes()
 o setAttributeSizes
 public void setAttributeSizes(Vector attSizes)

All Packages  Class Hierarchy  This Package  Previous  Next  Index