-
Notifications
You must be signed in to change notification settings - Fork 0
/
Predicate.cpp
37 lines (34 loc) · 1.04 KB
/
Predicate.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "Predicate.h"
Predicate::Predicate(std::string name, std::vector<Parameter*> parameters) {
this->name = name;
this->parameters = parameters;
}
Predicate::~Predicate() {}
std::string Predicate::getName() {
return name;
}
std::vector<std::string> Predicate::getParameters() const {
std::vector<std::string> outputParameters;
for (unsigned int i=0; i<parameters.size(); i++) {
outputParameters.push_back(parameters[i]->toString());
}
return outputParameters;
}
std::vector<Parameter*> Predicate::getParameters(bool asParameters) const {
return parameters;
}
std::string Predicate::getPofIndex(int index) {
return parameters.at(index)->toString();
}
unsigned int Predicate::getLength() const {
return parameters.size();
}
std::string Predicate::toString() {
std::string output = "";
output += name + "(";
for (unsigned int i=0; i<parameters.size()-1; i++) {
output += parameters[i]->toString() + ",";
}
output += parameters[parameters.size()-1]->toString() + ")";
return output;
}