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 {
|
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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue