Update Attribute.h
This commit is contained in:
parent
b2e36b3056
commit
cf5ad99b9f
1 changed files with 30 additions and 8 deletions
36
Attribute.h
36
Attribute.h
|
@ -9,7 +9,6 @@ using namespace std;
|
|||
class Attribute {
|
||||
//a named column of a relation
|
||||
string name;
|
||||
|
||||
bool isKey;
|
||||
int size;
|
||||
|
||||
|
@ -31,17 +30,40 @@ public:
|
|||
|
||||
void display()
|
||||
{
|
||||
cout<<"Atribute name:\t"<<name<<"\n";
|
||||
cout<<"Elements: ";
|
||||
//cout<<"\nAtribute name:\t"<<name<<"\n";
|
||||
//cout<<"Elements: ";
|
||||
for (int i = 0; i < values.size(); ++i)
|
||||
{
|
||||
cout<<values[i]<<" ";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
vector<string> getElements(){
|
||||
return values;
|
||||
int getSize()
|
||||
{
|
||||
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;
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
|
Reference in a new issue