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.
-
attributeNames
- the schema of the Table.
-
attributeSizes
- the sizes of attribute in the attributes of the
Table.
-
DEBUG
- Debug flag
-
relName
- the virtual name of this relation (for query breakdown)
-
tuples
- a number of tuples in this extent
-
Table()
- a new constructor without argument...
-
Table(int)
- constructs a relation extent object with a default size.
-
Table(Table)
- a copy constructor used to copy the extent.
-
addTuple(Tuple)
- adds a tuple at the end of this vector.
-
getAttributeNames()
-
-
getAttributeSizes()
-
-
getRelName()
-
-
getSize()
- returns the number of tuples in this relation.
-
getTuple(int)
- gets the tuples at index i
-
getTuples()
- return this Table's vector of tuples (the reference,
not a clone)
-
removeTuple(Tuple, int)
- searches for a certain tuple with the tuple's equals method
and removes it from the extent.
-
setAttributeNames(Vector)
-
-
setAttributeSizes(Vector)
-
-
setRelName(String)
-
-
toString()
- string representation (calls toString for all tuples, one line each).
DEBUG
public static final boolean DEBUG
- Debug flag
tuples
private Vector tuples
- a number of tuples in this extent
attributeNames
private Vector attributeNames
- the schema of the Table. A vector of Strings
(attribute names)
attributeSizes
private Vector attributeSizes
- the sizes of attribute in the attributes of the
Table. A vector of Integer (lengths)
relName
private String relName
- the virtual name of this relation (for query breakdown)
Table
public Table()
- a new constructor without argument... trying to get rid of the
peer object
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)
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
getTuples
public Vector getTuples()
- return this Table's vector of tuples (the reference,
not a clone)
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
getSize
public int getSize()
- returns the number of tuples in this relation.
- Returns:
- -1 if there are no tuples
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.
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
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
getRelName
public String getRelName()
setRelName
public void setRelName(String name)
getAttributeNames
public Vector getAttributeNames()
setAttributeNames
public void setAttributeNames(Vector attNames)
getAttributeSizes
public Vector getAttributeSizes()
setAttributeSizes
public void setAttributeSizes(Vector attSizes)
All Packages Class Hierarchy This Package Previous Next Index