-
Notifications
You must be signed in to change notification settings - Fork 0
/
Position.java
174 lines (143 loc) · 5.32 KB
/
Position.java
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from .idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
import com.rti.dds.infrastructure.*;
import com.rti.dds.infrastructure.Copyable;
import java.io.Serializable;
import com.rti.dds.cdr.CdrHelper;
public class Position implements Copyable, Serializable{
public String timestamp= "" ; /* maximum length = (255) */
public String route= "" ; /* maximum length = (255) */
public String vehicle= "" ; /* maximum length = (255) */
public int stopNumber= 0;
public int numStops= 0;
public double timeBetweenStops= 0;
public String trafficConditions= "" ; /* maximum length = (255) */
public int fillInRatio= 0;
public Position() {
}
public Position (Position other) {
this();
copy_from(other);
}
public static Object create() {
Position self;
self = new Position();
self.clear();
return self;
}
public void clear() {
timestamp= "";
route= "";
vehicle= "";
stopNumber= 0;
numStops= 0;
timeBetweenStops= 0.0;
trafficConditions= "";
fillInRatio= 0;
}
public boolean equals(Object o) {
if (o == null) {
return false;
}
if(getClass() != o.getClass()) {
return false;
}
Position otherObj = (Position)o;
if(!timestamp.equals(otherObj.timestamp)) {
return false;
}
if(!route.equals(otherObj.route)) {
return false;
}
if(!vehicle.equals(otherObj.vehicle)) {
return false;
}
if(stopNumber != otherObj.stopNumber) {
return false;
}
if(numStops != otherObj.numStops) {
return false;
}
if(timeBetweenStops != otherObj.timeBetweenStops) {
return false;
}
if(!trafficConditions.equals(otherObj.trafficConditions)) {
return false;
}
if(fillInRatio != otherObj.fillInRatio) {
return false;
}
return true;
}
public int hashCode() {
int __result = 0;
__result += timestamp.hashCode();
__result += route.hashCode();
__result += vehicle.hashCode();
__result += (int)stopNumber;
__result += (int)numStops;
__result += (int)timeBetweenStops;
__result += trafficConditions.hashCode();
__result += (int)fillInRatio;
return __result;
}
/**
* This is the implementation of the <code>Copyable</code> interface.
* This method will perform a deep copy of <code>src</code>
* This method could be placed into <code>PositionTypeSupport</code>
* rather than here by using the <code>-noCopyable</code> option
* to rtiddsgen.
*
* @param src The Object which contains the data to be copied.
* @return Returns <code>this</code>.
* @exception NullPointerException If <code>src</code> is null.
* @exception ClassCastException If <code>src</code> is not the
* same type as <code>this</code>.
* @see com.rti.dds.infrastructure.Copyable#copy_from(java.lang.Object)
*/
public Object copy_from(Object src) {
Position typedSrc = (Position) src;
Position typedDst = this;
typedDst.timestamp = typedSrc.timestamp;
typedDst.route = typedSrc.route;
typedDst.vehicle = typedSrc.vehicle;
typedDst.stopNumber = typedSrc.stopNumber;
typedDst.numStops = typedSrc.numStops;
typedDst.timeBetweenStops = typedSrc.timeBetweenStops;
typedDst.trafficConditions = typedSrc.trafficConditions;
typedDst.fillInRatio = typedSrc.fillInRatio;
return this;
}
public String toString(){
return toString("", 0);
}
public String toString(String desc, int indent) {
StringBuffer strBuffer = new StringBuffer();
if (desc != null) {
CdrHelper.printIndent(strBuffer, indent);
strBuffer.append(desc).append(":\n");
}
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("timestamp: ").append(timestamp).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("route: ").append(route).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("vehicle: ").append(vehicle).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("stopNumber: ").append(stopNumber).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("numStops: ").append(numStops).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("timeBetweenStops: ").append(timeBetweenStops).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("trafficConditions: ").append(trafficConditions).append("\n");
CdrHelper.printIndent(strBuffer, indent+1);
strBuffer.append("fillInRatio: ").append(fillInRatio).append("\n");
return strBuffer.toString();
}
}