- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGraphFilter.java
More file actions
Latest commit
123 lines (97 loc) · 2.25 KB
/
Copy pathGraphFilter.java
File metadata and controls
123 lines (97 loc) · 2.25 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
packagegraph;
/** A Graph that delegates all its operations to another, preexisting
* Graph object. This is intended to be extended, and selected methods
* overridden, as needed.
* @author P. N. Hilfinger */
publicclassGraphFilterextendsGraph {
/** A Graph that delegates all operations to G. */
publicGraphFilter(GraphG) {
_G = G;
}
@Override
publicintadd() {
return_G.add();
}
@Override
publicintadd(intu, intv) {
return_G.add(u, v);
}
@Override
publicvoidremove(intv) {
_G.remove(v);
}
@Override
publicvoidremove(intu, intv) {
_G.remove(u, v);
}
@Override
publicintvertexSize() {
return_G.vertexSize();
}
@Override
publicintmaxVertex() {
return_G.maxVertex();
}
@Override
publicintedgeSize() {
return_G.edgeSize();
}
@Override
publicbooleanisDirected() {
return_G.isDirected();
}
@Override
publicintoutDegree(intv) {
return_G.outDegree(v);
}
@Override
publicintinDegree(intv) {
return_G.inDegree(v);
}
@Override
publicbooleancontains(intu) {
return_G.contains(u);
}
@Override
publicbooleancontains(intu, intv) {
return_G.contains(u, v);
}
@Override
publicIteration<Integer> vertices() {
return_G.vertices();
}
@Override
publicIteration<Integer> successors(intv) {
return_G.successors(v);
}
@Override
publicintsuccessor(intv, intk) {
return_G.successor(v, k);
}
@Override
publicintpredecessor(intv, intk) {
return_G.predecessor(v, k);
}
@Override
publicIteration<Integer> predecessors(intv) {
return_G.predecessors(v);
}
@Override
publicIteration<int[]> edges() {
return_G.edges();
}
@Override
protectedbooleanmine(intv) {
return_G.mine(v);
}
@Override
protectedintedgeId(intu, intv) {
return_G.edgeId(u, v);
}
@Override
protectedvoidcheckMyVertex(intv) {
_G.checkMyVertex(v);
}
/** My underlying graph. */
privatefinalGraph_G;
}