|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| package org.rblasch.convert.graph; |
|
17 |
| |
|
18 |
| public final class Connection { |
|
19 |
| private final Vertex start, end; |
|
20 |
| private final Edge edge; |
|
21 |
| |
|
22 |
2981
| public Connection(final Vertex start, final Edge edge, final Vertex end) {
|
|
23 |
2981
| this.start = start;
|
|
24 |
2981
| this.edge = edge;
|
|
25 |
2981
| this.end = end;
|
|
26 |
| } |
|
27 |
| |
|
28 |
1657755
| public Vertex getStart() {
|
|
29 |
1657755
| return start;
|
|
30 |
| } |
|
31 |
| |
|
32 |
13506
| public Edge getEdge() {
|
|
33 |
13506
| return edge;
|
|
34 |
| } |
|
35 |
| |
|
36 |
64659
| public Vertex getEnd() {
|
|
37 |
64659
| return end;
|
|
38 |
| } |
|
39 |
| |
|
40 |
9097
| public String toString() {
|
|
41 |
9097
| return start + " " + edge + " " + end;
|
|
42 |
| } |
|
43 |
| |
|
44 |
| |
|
45 |
641
| public boolean equals(final Object o) {
|
|
46 |
0
| if (this == o) return true;
|
|
47 |
0
| if (!(o instanceof Connection)) return false;
|
|
48 |
| |
|
49 |
641
| final Connection connection = (Connection) o;
|
|
50 |
| |
|
51 |
0
| if (!edge.equals(connection.edge)) return false;
|
|
52 |
0
| if (!end.equals(connection.end)) return false;
|
|
53 |
0
| if (!start.equals(connection.start)) return false;
|
|
54 |
| |
|
55 |
641
| return true;
|
|
56 |
| } |
|
57 |
| |
|
58 |
15275
| public int hashCode() {
|
|
59 |
15275
| int result;
|
|
60 |
15275
| result = start.hashCode();
|
|
61 |
15275
| result = 29 * result + end.hashCode();
|
|
62 |
15275
| result = 29 * result + edge.hashCode();
|
|
63 |
15275
| return result;
|
|
64 |
| } |
|
65 |
| } |