This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/Attribute.h

64 lines
897 B
C
Raw Normal View History

2015-09-15 18:56:40 -05:00
#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;
vector<string> values;
bool isKey;
int size;
public:
void initializeAttribute(string n, vector<string> a){
name = n;
values = a;
}
string getName(){
return name;
}
Attribute(){ }
void display()
{
2015-09-15 20:21:19 -05:00
cout<<"\nAtribute name:\t"<<name<<"\n";
2015-09-15 18:56:40 -05:00
cout<<"Elements: ";
for (int i = 0; i < values.size(); ++i)
{
cout<<values[i]<<" ";
}
}
2015-09-15 20:21:19 -05:00
int getSize()
{
return values.size();
}
2015-09-15 18:56:40 -05:00
/*
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;
}
*/
};