コード例 #1
0
ファイル: GraphUnion.java プロジェクト: CaoAo/BeehiveZ
 public E getEdge(V sourceVertex, V targetVertex) {
   E res = null;
   if (g1.containsVertex(sourceVertex) && g1.containsVertex(targetVertex)) {
     res = g1.getEdge(sourceVertex, targetVertex);
   }
   if ((res == null) && g2.containsVertex(sourceVertex) && g2.containsVertex(targetVertex)) {
     res = g2.getEdge(sourceVertex, targetVertex);
   }
   return res;
 }
コード例 #2
0
ファイル: GraphUnion.java プロジェクト: CaoAo/BeehiveZ
 public Set<E> edgesOf(V vertex) {
   Set<E> res = new HashSet<E>();
   if (g1.containsVertex(vertex)) {
     res.addAll(g1.edgesOf(vertex));
   }
   if (g2.containsVertex(vertex)) {
     res.addAll(g2.edgesOf(vertex));
   }
   return Collections.unmodifiableSet(res);
 }
コード例 #3
0
ファイル: GraphUnion.java プロジェクト: CaoAo/BeehiveZ
 public Set<E> getAllEdges(V sourceVertex, V targetVertex) {
   Set<E> res = new HashSet<E>();
   if (g1.containsVertex(sourceVertex) && g1.containsVertex(targetVertex)) {
     res.addAll(g1.getAllEdges(sourceVertex, targetVertex));
   }
   if (g2.containsVertex(sourceVertex) && g2.containsVertex(targetVertex)) {
     res.addAll(g2.getAllEdges(sourceVertex, targetVertex));
   }
   return Collections.unmodifiableSet(res);
 }
コード例 #4
0
ファイル: GraphUnion.java プロジェクト: CaoAo/BeehiveZ
 public boolean containsVertex(V v) {
   return g1.containsVertex(v) || g2.containsVertex(v);
 }