attributes.h
Go to the documentation of this file.
1 #ifndef ATTRIBUTES_H
2 #define ATTRIBUTES_H
3 
4 /*
5  * attributes.h
6  * Copyright (c) 2016 Georgetown University. All Rights Reserved.
7  */
8 
16 #include <string>
17 #include <iostream>
18 #include <vector>
19 #include <stdexcept>
20 #include <typeinfo>
21 #include "attribute.h"
22 #include "attributefactory.h"
23 
24 using namespace std;
25 
26 class Attributes {
27 
36  friend ostream &operator<<( ostream &out, const Attributes &a );
37 
38  private:
39 
41  vector<Attribute *> attributes;
42 
45 
48 
51 
52  public:
53 
55  Attributes();
56 
64  void add( Attribute *attribute ) throw ( logic_error );
65 
73  int getClassIndex() const throw ( logic_error );
74 
82  bool getHasNominalAttributes() const;
83 
91  bool getHasNumericAttributes() const;
92 
101  Attribute *get( int i ) const throw ( logic_error );
102 
110  Attribute *getClassAttribute() const throw ( logic_error );
111 
120  int getIndex( string name ) const throw ( logic_error );
121 
128  int getSize() const;
129 
139  void parse( istream &in ) throw ( logic_error );
140 
148  void setClassIndex( int classIndex ) throw ( logic_error );
149 
150 }; // Attributes class
151 
152 #endif
bool hasNumericAttributes
Definition: attributes.h:44
vector< Attribute * > attributes
Definition: attributes.h:41
Definition: attribute.h:21
int classIndex
Definition: attributes.h:50
Definition: attributes.h:26
ostream & operator<<(ostream &out, const Attribute &a)
Definition: attribute.cc:31
bool hasNominalAttributes
Definition: attributes.h:47