-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVehicle.java
More file actions
141 lines (110 loc) · 3.83 KB
/
Vehicle.java
File metadata and controls
141 lines (110 loc) · 3.83 KB
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
/*
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 Vehicle implements Copyable, Serializable{
public String vId= "" ; /* maximum length = (255) */
public Breakdown breakdown = (Breakdown)Breakdown.create();
public Accident accident = (Accident)Accident.create();
public Position position = (Position)Position.create();
public Vehicle() {
}
public Vehicle (Vehicle other) {
this();
copy_from(other);
}
public static Object create() {
Vehicle self;
self = new Vehicle();
self.clear();
return self;
}
public void clear() {
vId= "";
if (breakdown != null) {
breakdown.clear();
}
if (accident != null) {
accident.clear();
}
if (position != null) {
position.clear();
}
}
public boolean equals(Object o) {
if (o == null) {
return false;
}
if(getClass() != o.getClass()) {
return false;
}
Vehicle otherObj = (Vehicle)o;
if(!vId.equals(otherObj.vId)) {
return false;
}
if(!breakdown.equals(otherObj.breakdown)) {
return false;
}
if(!accident.equals(otherObj.accident)) {
return false;
}
if(!position.equals(otherObj.position)) {
return false;
}
return true;
}
public int hashCode() {
int __result = 0;
__result += vId.hashCode();
__result += breakdown.hashCode();
__result += accident.hashCode();
__result += position.hashCode();
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>VehicleTypeSupport</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) {
Vehicle typedSrc = (Vehicle) src;
Vehicle typedDst = this;
typedDst.vId = typedSrc.vId;
typedDst.breakdown = (Breakdown) typedDst.breakdown.copy_from(typedSrc.breakdown);
typedDst.accident = (Accident) typedDst.accident.copy_from(typedSrc.accident);
typedDst.position = (Position) typedDst.position.copy_from(typedSrc.position);
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("vId: ").append(vId).append("\n");
strBuffer.append(breakdown.toString("breakdown ", indent+1));
strBuffer.append(accident.toString("accident ", indent+1));
strBuffer.append(position.toString("position ", indent+1));
return strBuffer.toString();
}
}