Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseGraph.addEdge()


    {
      DeterministicVertex newSrc = DeterministicDirectedSparseGraph.copyVertex(newVertices,result,e.getSource()),
        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet<String>)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }

  /** Returns an array of sequential numbers 0..howMany, randomly permuted.
View Full Code Here


    {
      DeterministicVertex newSrc = DeterministicDirectedSparseGraph.copyVertex(newVertices,result,e.getSource()),
        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet<String>)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }

  /** Returns an array of sequential numbers 0..howMany, randomly permuted.
View Full Code Here

        newEdges.add(newEdge);
      }
    }
   
    for(Edge e:newEdges)
      g.addEdge(e);
   
    for(DirectedSparseVertex v:(Set<DirectedSparseVertex>)g.getVertices())
    {
       v.addUserDatum(VERTEX, v.getUserDatum(JUConstants.LABEL), UserData.SHARED);
       v.removeUserDatum(JUConstants.LABEL);
View Full Code Here

        DeterministicEdge edge = existingEdges.get(pair);
        if (edge == null)
        {
          edge = new DeterministicDirectedSparseGraph.DeterministicEdge(fromVertex,toVertex);
          edge.addUserDatum(JUConstants.LABEL, new HashSet<String>(), UserData.CLONE);
          g.addEdge(edge);existingEdges.put(pair,edge);
        }
       
        Set<String> labels = (Set<String>)edge.getUserDatum(JUConstants.LABEL);
        labels.add(label);
      }
View Full Code Here

        for(Entry<CmpVertex,Set<Label>> tgtEntry:entry.getValue().entrySet())
        {
          DeterministicVertex target = oldToNew.get(tgtEntry.getKey());
          DeterministicEdge e = new DeterministicEdge(source,target);
          e.addUserDatum(JUConstants.LABEL, tgtEntry.getValue(), UserData.CLONE);
          result.addEdge(e);
        }
      }
    }
    return result;
  }
View Full Code Here

        DeterministicEdge edge = existingEdges.get(pair);
        if (edge == null)
        {
          edge = new DeterministicDirectedSparseGraph.DeterministicEdge(fromVertex,toVertex);
          edge.addUserDatum(JUConstants.LABEL, new HashSet<String>(), UserData.CLONE);
          g.addEdge(edge);existingEdges.put(pair,edge);
        }
       
        Set<String> labels = (Set<String>)edge.getUserDatum(JUConstants.LABEL);
        labels.add(label);
      }
View Full Code Here

        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      Set<Label> origLabels = (Set<Label>)e.getUserDatum(JUConstants.LABEL);
      TreeSet<Label> copiedLabels = new TreeSet<Label>();copiedLabels.addAll(origLabels);
      newEdge.addUserDatum(JUConstants.LABEL, copiedLabels, UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }

  /** Returns an array of sequential numbers 0..howMany, randomly permuted.
View Full Code Here

          CmpVertex targetOld = tgtEntry.getKey();
          assert coregraph.findVertex(targetOld) == targetOld : "was looking for vertex with name "+targetOld+", got "+coregraph.findVertex(targetOld);
          DeterministicVertex target = oldToNew.get(targetOld);
          DeterministicEdge e = new DeterministicEdge(source,target);
          e.addUserDatum(JUConstants.LABEL, tgtEntry.getValue(), UserData.CLONE);
          result.addEdge(e);
        }
      }
    }
    return result;
  }
View Full Code Here

    {
      CmpVertex newSrc = copyVertex(newVertices,result,e.getSource()),
        newDst = copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }
 
  /** Takes states associated with red in mergedVertices and finds a target state for a given input
View Full Code Here

        }
        if (fromSourceToNewRed == null)
        {
          fromSourceToNewRed = new DirectedSparseEdge(source,newRed);
          fromSourceToNewRed.setUserDatum(JUConstants.LABEL, existingLabels, UserData.CLONE);// no need to clone this one since I'll delete the edge in a bit
          g.addEdge(fromSourceToNewRed);
        }
        else
          // there is already a transition from source to newRed, hence all we have to do is merge the new labels into it.
          ((Collection<String>)fromSourceToNewRed.getUserDatum(JUConstants.LABEL)).addAll( existingLabels );
         
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.