-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrimen.hxx
145 lines (116 loc) · 3 KB
/
crimen.hxx
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
crimen::crimen(){
ID=0;
arrest=false;
domestic=false;
}
crimen::crimen(const crimen& x){
ID=x.ID;
casenumber=x.casenumber;
date=x.date;
iucr=x.iucr;
primarytype=x.primarytype;
description=x.description;
location_descrip=x.location_descrip;
arrest=x.arrest;
domestic=x.domestic;
latitude=x.latitude;
longitude=x.longitude;
}
void crimen::setID(long int & id){
ID=id;
}
void crimen::setCaseNumber(const string & s){
casenumber=s;
}
void crimen::setDate(const fecha & d){
date=d;
}
void crimen::setIucr(const string & s){
iucr = s;
}
void crimen::setPrimaryType(const string & s){
primarytype = s;
}
void crimen::setDescription(const string & s){
description = s;
}
void crimen::setLocationDescription(const string & s){
location_descrip = s;
}
void crimen::setArrest(bool a){
arrest = a;
}
void crimen::setDomestic(bool d){
domestic = d;
}
void crimen::setLatitude(double & lat){
latitude = lat;
}
void crimen::setLongitude(double & lon){
longitude = lon;
}
long int crimen::getID( ) const{
return ID;
}
string crimen::getCaseNumber( ) const{
return casenumber;
}
fecha crimen::getDate( ) const{
return date;
}
string crimen::getIucr( ) const{
return iucr;
}
string crimen::getPrimaryType( ) const{
return primarytype;
}
string crimen::getDescription( ) const{
return description;
}
string crimen::getLocationDescription( ) const{
return location_descrip;
}
bool crimen::getArrest( ) const{
return arrest;
}
bool crimen::getDomestic( ) const{
return domestic;
}
double crimen::getLatitude( ) const{
return latitude;
}
double crimen::getLongitude( ) const{
return longitude;
}
crimen & crimen::operator=(const crimen & x){
ID=x.ID;
casenumber=x.casenumber;
date=x.date;
iucr=x.iucr;
primarytype=x.primarytype;
description=x.description;
location_descrip=x.location_descrip;
arrest=x.arrest;
domestic=x.domestic;
latitude=x.latitude;
longitude=x.longitude;
}
bool crimen::operator==(const crimen & x) const{
if(this->ID == x.ID && this-> casenumber == x.casenumber && this->date == x.date && this->iucr == x.iucr && this->primarytype == x.primarytype && this->description == x.description
&& this->location_descrip == x.location_descrip && this->arrest == x.arrest && this->domestic == x.domestic && this->latitude == x.latitude && this->longitude == x.longitude){
return true;
}
else{
return false;
}
}
bool crimen::operator<(const crimen & x) const{
if(date < x.date)
return true;
else
return false;
}
ostream& operator<< ( ostream &os , const crimen& c){
os << c.ID << "," << c.casenumber << "," << c.date << "," << c.iucr << "," << c.primarytype << "," << c.description << "," << c.location_descrip << "," << c.arrest << "," << c.domestic << "," << c.latitude << "," << c.longitude;
return os;
}