nominal.h
Go to the documentation of this file.
1 #ifndef NOMINAL_H
2 #define NOMINAL_H
3 
4 /*
5  * nominal.h
6  * Copyright (c) 2016 Georgetown University. All Rights Reserved.
7  */
8 
9 #include <string>
10 #include <vector>
11 #include <stdexcept>
12 #include "attribute.h"
13 
14 using namespace std;
15 
24 class NominalAttribute : public Attribute {
25 
34  friend ostream &operator<<( ostream &out, const NominalAttribute &na );
35 
36  private:
37 
39  vector<string> domain;
40 
41  public:
42 
46 
54  NominalAttribute( string name );
55 
63  void addValue( string value ) throw ( logic_error );
64 
71  virtual int getSize() const;
72 
80  string getValue( int index ) throw ( logic_error );
81 
90  int getIndex( string value ) throw ( logic_error );
91 
98  virtual void print( ostream &out = cout ) const;
99 
100 }; // NominalAttribute class
101 
102 #endif
vector< string > domain
Definition: nominal.h:39
Definition: attribute.h:21
Definition: nominal.h:24
ostream & operator<<(ostream &out, const Attribute &a)
Definition: attribute.cc:31