|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| package org.rblasch.convert; |
|
17 |
| |
|
18 |
| import org.rblasch.convert.graph.WeightedDirectedEdge; |
|
19 |
| |
|
20 |
| public final class ConverterEdge implements WeightedDirectedEdge { |
|
21 |
| private final MetaConverter converter; |
|
22 |
| private final int weight; |
|
23 |
| |
|
24 |
1769
| public ConverterEdge(final MetaConverter converter, final int weight) {
|
|
25 |
1769
| this.converter = converter;
|
|
26 |
1769
| this.weight = weight;
|
|
27 |
| } |
|
28 |
| |
|
29 |
1090
| public MetaConverter getConverter() {
|
|
30 |
1090
| return converter;
|
|
31 |
| } |
|
32 |
| |
|
33 |
11204
| public int getWeight() {
|
|
34 |
11204
| return weight;
|
|
35 |
| } |
|
36 |
| |
|
37 |
9097
| public String toString() {
|
|
38 |
9097
| return "-(" + weight + ")->";
|
|
39 |
| } |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
1282
| public boolean equals(final Object o) {
|
|
44 |
0
| if (this == o) return true;
|
|
45 |
0
| if (!(o instanceof ConverterEdge)) return false;
|
|
46 |
| |
|
47 |
1282
| final ConverterEdge converterEdge = (ConverterEdge) o;
|
|
48 |
0
| if (weight != converterEdge.weight) return false;
|
|
49 |
0
| if (!converter.equals(converterEdge.converter)) return false;
|
|
50 |
| |
|
51 |
1282
| return true;
|
|
52 |
| } |
|
53 |
| |
|
54 |
18256
| public int hashCode() {
|
|
55 |
18256
| int result;
|
|
56 |
18256
| result = converter.hashCode();
|
|
57 |
18256
| result = 29 * result + weight;
|
|
58 |
18256
| return result;
|
|
59 |
| } |
|
60 |
| } |