Update Attribute.h

This commit is contained in:
Brandon Jackson 2015-09-15 20:21:26 -05:00
parent 758d3e55cc
commit d4e1e5bc04

View file

@ -5,33 +5,43 @@ using namespace std;
//Funtional, might need more functionality
template<typename T>
//template<typename T>
class Attribute {
//a named column of a relation
string name;
vector<T> values;
bool isKey;
int size;
public:
Attribute(){ }
Attribute(vector<T> v){
this.values = v;
}
vector<string> values;
Attribute(const Attribute<T>& a){
this.values = a.getAll();
}
void initializeAttribute(string n, vector<string> a){
Attribute& operator=(const Attribute<T>& a){
this.values = a.getAll();
name = n;
values = a;
}
string getName(){
return name;
}
vector<T> getAll(){
return this.values;
Attribute(){ }
void display()
{
cout<<"Atribute name:\t"<<name<<"\n";
cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i)
{
cout<<values[i]<<" ";
}
}
/*
vector<string> getElements(){
return values;
}
*/
};