fixed my stuff

This commit is contained in:
Rebecca Schofield 2015-09-15 22:08:18 -05:00
parent 5010901a32
commit 992157c88d
2 changed files with 7 additions and 2 deletions

View file

@ -41,7 +41,7 @@ public:
void display() void display()
{ {
cout<<"Atribute name:\t"<<name<<"\n"; cout<<"Attribute name:\t"<< name <<"\n";
cout<<"Elements: "; cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)

View file

@ -6,6 +6,7 @@
class Relation { class Relation {
string name; //The title the user gives it string name; //The title the user gives it
vector<Attribute> att; //A vector of the columns vector<Attribute> att; //A vector of the columns
itn size;
public: public:
Relation(); Relation();
@ -14,6 +15,7 @@ public:
Relation(string n, vector<Attribute> a) { Relation(string n, vector<Attribute> a) {
name = n; name = n;
att = a; att = a;
size = 0;
} }
void addTuple(vector<string> tuple) { void addTuple(vector<string> tuple) {
@ -25,10 +27,13 @@ public:
//In this column, at this element's spot, assign an element from the tuple vector to this spot //In this column, at this element's spot, assign an element from the tuple vector to this spot
att[i].addRow(tuple[i]); att[i].addRow(tuple[i]);
size++;
} }
} }
} }
int getSize() { return size; }
string getTableName() { string getTableName() {
return name; return name;
} }