|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DSRG.MW.Table
this class holds a number of tuples. It's used for holding relation extents.
Field Summary | |
private java.util.Vector |
attributeNames
the schema of the Table. |
private java.util.Vector |
attributeSizes
the sizes of attribute in the attributes of the Table. |
static boolean |
DEBUG
Debug flag |
private java.lang.String |
relName
the virtual name of this relation (for query breakdown) |
private java.util.Vector |
tuples
a number of tuples in this extent |
Constructor Summary | |
Table()
a new constructor without argument... |
|
Table(int capacity)
constructs a relation extent object with a default size. |
|
Table(Table oldTable)
a copy constructor used to copy the extent of this table. |
Method Summary | |
void |
addTuple(Tuple t)
adds a tuple at the end of this vector. |
java.util.Vector |
getAttributeNames()
|
java.util.Vector |
getAttributeSizes()
|
java.util.Vector |
getColumn(int index)
returns the n-th column (starting count with 0) as a vector of strings |
java.util.Vector |
getColumn(java.lang.String attName)
returns the named column as a vector of strings |
java.lang.String |
getRelName()
|
int |
getSize()
returns the number of tuples in this relation. |
Tuple |
getTuple(int i)
gets the tuples at index i |
java.util.Vector |
getTuples()
return this Table's Vector of tuples (the reference, not a clone) |
int |
removeTuple(Tuple t,
int multiplicity)
searches for a certain tuple with the tuple's equals method and removes it from the extent. |
void |
setAttributeNames(java.util.Vector attNames)
|
void |
setAttributeSizes(java.util.Vector attSizes)
|
boolean |
setColumn(Table currentColumn)
"joins" this table with another. |
void |
setRelName(java.lang.String name)
|
java.lang.String |
toString()
string representation (calls toString for all tuples, one line each). |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final boolean DEBUG
private java.util.Vector tuples
private java.util.Vector attributeNames
private java.util.Vector attributeSizes
private java.lang.String relName
Constructor Detail |
public Table()
public Table(int capacity)
public Table(Table oldTable)
Method Detail |
public java.util.Vector getTuples()
public java.util.Vector getColumn(int index)
public java.util.Vector getColumn(java.lang.String attName)
public Tuple getTuple(int i)
i
- the index of the tuple to be retrievedpublic int getSize()
public void addTuple(Tuple t)
public int removeTuple(Tuple t, int multiplicity)
multiplicity
times.multiplicity
of 0, then something is wrongpublic boolean setColumn(Table currentColumn)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRelName()
public void setRelName(java.lang.String name)
public java.util.Vector getAttributeNames()
public void setAttributeNames(java.util.Vector attNames)
public java.util.Vector getAttributeSizes()
public void setAttributeSizes(java.util.Vector attSizes)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |