-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTuple.java
More file actions
37 lines (31 loc) · 845 Bytes
/
Copy pathTuple.java
File metadata and controls
37 lines (31 loc) · 845 Bytes
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
import java.io.Serializable;
import java.util.Vector;
public class Tuple implements Serializable {
private Vector<Object> data = new Vector<Object>();
public Tuple(Vector<Object> data) {
this.data = data;
}
public Tuple(){
}
public String toString() {
String x = "";
for (int i = 0; i < data.size() - 1; i++) {
x = x + data.get(i) + ",";
}
x = x + data.get(data.size() - 1);
return x;
}
public Vector<Object> getData() {
return data;
}
public boolean compareTo(Tuple t) {
if (t.data.size() != data.size())
return false;
for (int i = 0; i < data.size() - 1; i++) {
if (!(t.data.get(i).equals(data.get(i)))) {
return false;
}
}
return true;
}
}