-
Notifications
You must be signed in to change notification settings - Fork 0
/
NamedVariableCollection.js
42 lines (42 loc) · 1.37 KB
/
NamedVariableCollection.js
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
38
39
40
41
42
///<reference path="NamedVariable.ts"/>
/**
* Created by Evan on 10/17/2016.
*/
var NamedVariableCollection = (function () {
function NamedVariableCollection() {
this.variables = [];
}
NamedVariableCollection.prototype.add = function (variable) {
this.variables.push(variable);
};
NamedVariableCollection.prototype.containsName = function (name) {
for (var _i = 0, _a = this.variables; _i < _a.length; _i++) {
var variable = _a[_i];
console.log(variable.name + " vs " + name);
if (variable.name == name) {
return true;
}
}
return false;
};
NamedVariableCollection.prototype.get = function (name) {
for (var _i = 0, _a = this.variables; _i < _a.length; _i++) {
var variable = _a[_i];
if (variable.name == name) {
return variable;
}
}
return null;
};
NamedVariableCollection.prototype.toString = function () {
var builder = new StringBuilder();
for (var _i = 0, _a = this.variables; _i < _a.length; _i++) {
var variable = _a[_i];
builder.append(variable.toString());
builder.append("\n");
}
return builder.toString();
};
return NamedVariableCollection;
}());
//# sourceMappingURL=NamedVariableCollection.js.map