-
Notifications
You must be signed in to change notification settings - Fork 1
/
TGString.h
51 lines (39 loc) · 873 Bytes
/
TGString.h
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
43
44
45
46
47
48
49
50
51
#ifndef TG_STRING_H
#define TG_STRING_H
#include "TGFactory.h"
class TGString
{
protected:
int number;
int value;
public:
TGString(){
number = 0;
value = 0;
}
int getNumber() {
return number;
}
int getValue() {
return value;
}
void setNumber(int aNumber) {
number = aNumber;
}
void setValue(int aValue) {
value = aValue;
}
bool isEqual(TGString *aString){
return (getNumber() == aString->getNumber() && getValue() == aString->getValue());
}
TGString* clone(TGFactory* factory){
TGString *string = factory->newString();
copy(string);
return string;
}
void copy(TGString *aString){
aString->setNumber(getNumber());
aString->setValue(getValue());
}
};
#endif