Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. package ru.kpfu.dfs.graph.adapter;
  2.  
  3. import ru.kpfu.dfs.graph.Graph;
  4.  
  5. import java.util.List;
  6.  
  7. /**
  8. * @author Alexeev Vladimir 27.04.2015
  9. */
  10. public class NotDirectedGraph implements Graph {
  11.  
  12. private Graph graph;
  13.  
  14. private NotDirectedGraph() {}
  15.  
  16. public NotDirectedGraph(Graph graph) {
  17. this.graph = graph;
  18. }
  19.  
  20. @Override
  21. public void joinVertices(int from, int to) {
  22. graph.joinVertices(from, to);
  23. graph.joinVertices(to, from);
  24. }
  25.  
  26. @Override
  27. public List<Integer> adjacentVertices(int vertex) {
  28. return graph.adjacentVertices(vertex);
  29. }
  30.  
  31. @Override
  32. public int size() {
  33. return graph.size();
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement