1 package edu.uci.ics.jung.graph;
2
3 import java.io.Serializable;
4 import java.util.Collection;
5
6 import edu.uci.ics.jung.graph.util.EdgeType;
7 import edu.uci.ics.jung.graph.util.Pair;
8
9
10
11
12
13
14
15 @SuppressWarnings("serial")
16 public class GraphDecorator<V,E> implements Graph<V,E>, Serializable {
17
18 protected Graph<V,E> delegate;
19
20
21
22
23
24 public GraphDecorator(Graph<V, E> delegate) {
25 this.delegate = delegate;
26 }
27
28
29
30
31 public boolean addEdge(E edge, Collection<? extends V> vertices) {
32 return delegate.addEdge(edge, vertices);
33 }
34
35
36
37
38 public boolean addEdge(E edge, Collection<? extends V> vertices, EdgeType
39 edge_type)
40 {
41 return delegate.addEdge(edge, vertices, edge_type);
42 }
43
44
45
46
47 public boolean addEdge(E e, V v1, V v2, EdgeType edgeType) {
48 return delegate.addEdge(e, v1, v2, edgeType);
49 }
50
51
52
53
54 public boolean addEdge(E e, V v1, V v2) {
55 return delegate.addEdge(e, v1, v2);
56 }
57
58
59
60
61 public boolean addVertex(V vertex) {
62 return delegate.addVertex(vertex);
63 }
64
65
66
67
68 public boolean isIncident(V vertex, E edge) {
69 return delegate.isIncident(vertex, edge);
70 }
71
72
73
74
75 public boolean isNeighbor(V v1, V v2) {
76 return delegate.isNeighbor(v1, v2);
77 }
78
79
80
81
82 public int degree(V vertex) {
83 return delegate.degree(vertex);
84 }
85
86
87
88
89 public E findEdge(V v1, V v2) {
90 return delegate.findEdge(v1, v2);
91 }
92
93
94
95
96 public Collection<E> findEdgeSet(V v1, V v2) {
97 return delegate.findEdgeSet(v1, v2);
98 }
99
100
101
102
103 public V getDest(E directed_edge) {
104 return delegate.getDest(directed_edge);
105 }
106
107
108
109
110 public int getEdgeCount() {
111 return delegate.getEdgeCount();
112 }
113
114
115
116
117 public int getEdgeCount(EdgeType edge_type)
118 {
119 return delegate.getEdgeCount(edge_type);
120 }
121
122
123
124
125 public Collection<E> getEdges() {
126 return delegate.getEdges();
127 }
128
129
130
131
132 public Collection<E> getEdges(EdgeType edgeType) {
133 return delegate.getEdges(edgeType);
134 }
135
136
137
138
139 public EdgeType getEdgeType(E edge) {
140 return delegate.getEdgeType(edge);
141 }
142
143
144
145
146 public EdgeType getDefaultEdgeType()
147 {
148 return delegate.getDefaultEdgeType();
149 }
150
151
152
153
154 public Pair<V> getEndpoints(E edge) {
155 return delegate.getEndpoints(edge);
156 }
157
158
159
160
161 public int getIncidentCount(E edge) {
162 return delegate.getIncidentCount(edge);
163 }
164
165
166
167
168 public Collection<E> getIncidentEdges(V vertex) {
169 return delegate.getIncidentEdges(vertex);
170 }
171
172
173
174
175 public Collection<V> getIncidentVertices(E edge) {
176 return delegate.getIncidentVertices(edge);
177 }
178
179
180
181
182 public Collection<E> getInEdges(V vertex) {
183 return delegate.getInEdges(vertex);
184 }
185
186
187
188
189 public int getNeighborCount(V vertex) {
190 return delegate.getNeighborCount(vertex);
191 }
192
193
194
195
196 public Collection<V> getNeighbors(V vertex) {
197 return delegate.getNeighbors(vertex);
198 }
199
200
201
202
203 public V getOpposite(V vertex, E edge) {
204 return delegate.getOpposite(vertex, edge);
205 }
206
207
208
209
210 public Collection<E> getOutEdges(V vertex) {
211 return delegate.getOutEdges(vertex);
212 }
213
214
215
216
217 public int getPredecessorCount(V vertex) {
218 return delegate.getPredecessorCount(vertex);
219 }
220
221
222
223
224 public Collection<V> getPredecessors(V vertex) {
225 return delegate.getPredecessors(vertex);
226 }
227
228
229
230
231 public V getSource(E directed_edge) {
232 return delegate.getSource(directed_edge);
233 }
234
235
236
237
238 public int getSuccessorCount(V vertex) {
239 return delegate.getSuccessorCount(vertex);
240 }
241
242
243
244
245 public Collection<V> getSuccessors(V vertex) {
246 return delegate.getSuccessors(vertex);
247 }
248
249
250
251
252 public int getVertexCount() {
253 return delegate.getVertexCount();
254 }
255
256
257
258
259 public Collection<V> getVertices() {
260 return delegate.getVertices();
261 }
262
263
264
265
266 public int inDegree(V vertex) {
267 return delegate.inDegree(vertex);
268 }
269
270
271
272
273 public boolean isDest(V vertex, E edge) {
274 return delegate.isDest(vertex, edge);
275 }
276
277
278
279
280 public boolean isPredecessor(V v1, V v2) {
281 return delegate.isPredecessor(v1, v2);
282 }
283
284
285
286
287 public boolean isSource(V vertex, E edge) {
288 return delegate.isSource(vertex, edge);
289 }
290
291
292
293
294 public boolean isSuccessor(V v1, V v2) {
295 return delegate.isSuccessor(v1, v2);
296 }
297
298
299
300
301 public int outDegree(V vertex) {
302 return delegate.outDegree(vertex);
303 }
304
305
306
307
308 public boolean removeEdge(E edge) {
309 return delegate.removeEdge(edge);
310 }
311
312
313
314
315 public boolean removeVertex(V vertex) {
316 return delegate.removeVertex(vertex);
317 }
318
319
320
321
322 public boolean containsEdge(E edge) {
323 return delegate.containsEdge(edge);
324 }
325
326
327
328
329 public boolean containsVertex(V vertex) {
330 return delegate.containsVertex(vertex);
331 }
332 }