1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.giraph.io.iterables;
20
21 import org.apache.giraph.edge.ReusableEdge;
22 import org.apache.hadoop.io.Writable;
23 import org.apache.hadoop.io.WritableComparable;
24
25
26
27
28
29
30
31 public class EdgeWithSource<I extends WritableComparable,
32 E extends Writable> {
33
34 private I sourceVertexId;
35
36 private ReusableEdge<I, E> edge;
37
38
39
40
41 public EdgeWithSource() {
42 }
43
44
45
46
47
48
49
50 public EdgeWithSource(I sourceVertexId, ReusableEdge<I, E> edge) {
51 this.sourceVertexId = sourceVertexId;
52 this.edge = edge;
53 }
54
55 public I getSourceVertexId() {
56 return sourceVertexId;
57 }
58
59 public void setSourceVertexId(I sourceVertexId) {
60 this.sourceVertexId = sourceVertexId;
61 }
62
63 public ReusableEdge<I, E> getEdge() {
64 return edge;
65 }
66
67 public void setEdge(ReusableEdge<I, E> edge) {
68 this.edge = edge;
69 }
70
71 public I getTargetVertexId() {
72 return edge.getTargetVertexId();
73 }
74
75
76
77
78
79
80 public void setTargetVertexId(I targetVertexId) {
81 edge.setTargetVertexId(targetVertexId);
82 }
83
84 public E getEdgeValue() {
85 return edge.getValue();
86 }
87
88
89
90
91
92
93 public void setEdgeValue(E value) {
94 edge.setValue(value);
95 }
96 }