Create Attribute.h
This commit is contained in:
parent
b842955e3e
commit
990dfa0056
1 changed files with 47 additions and 0 deletions
47
Attribute.h
Normal file
47
Attribute.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//Funtional, might need more functionality
|
||||
|
||||
//template<typename T>
|
||||
class Attribute {
|
||||
//a named column of a relation
|
||||
string name;
|
||||
|
||||
bool isKey;
|
||||
int size;
|
||||
|
||||
public:
|
||||
|
||||
vector<string> values;
|
||||
|
||||
void initializeAttribute(string n, vector<string> a){
|
||||
|
||||
name = n;
|
||||
values = a;
|
||||
}
|
||||
|
||||
string getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
*/
|
||||
};
|
Reference in a new issue