Update Attribute.h

This commit is contained in:
Brandon Jackson 2015-09-15 21:39:24 -05:00
parent b2e36b3056
commit cf5ad99b9f

View file

@ -9,7 +9,6 @@ using namespace std;
class Attribute { class Attribute {
//a named column of a relation //a named column of a relation
string name; string name;
bool isKey; bool isKey;
int size; int size;
@ -31,17 +30,40 @@ public:
void display() void display()
{ {
cout<<"Atribute name:\t"<<name<<"\n"; //cout<<"\nAtribute name:\t"<<name<<"\n";
cout<<"Elements: "; //cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i) for (int i = 0; i < values.size(); ++i)
{ {
cout<<values[i]<<" "; cout<<values[i]<<" ";
} }
} }
/* int getSize()
vector<string> getElements(){ {
return values; return values.size();
} }
*/
void pushBack(string s)
{
values.push_back(s);
}
/*
Attribute(vector<string> v){
this.values = v;
}
Attribute(const Attribute<string>& a){
this.values = a.getAll();
}
Attribute& operator=(const Attribute<string>& a){
this.values = a.getAll();
}
vector<string> getAll(){
return this.values;
}
*/
}; };