Examples of addUserDatum()


Examples of edu.uci.ics.jung.graph.Vertex.addUserDatum()

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

Examples of edu.uci.ics.jung.graph.Vertex.addUserDatum()

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.AbstractSparseEdge.addUserDatum()

                jungEdge = new DirectedSparseEdge(startVertex, endVertex);
              } else {
                jungEdge = new UndirectedSparseEdge(startVertex, endVertex);
              }

              jungEdge.addUserDatum(ELASTIC_LENGTH_KEY, new Double(elasticEdge
                  .getLength()), UserData.SHARED);

              myEdgeMap.put(uiEdge, jungEdge);

              myGraph.addEdge(jungEdge);
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

    /*
     * Build the actual edge & attach it to the graph.
     * */
    Edge edge = new DirectedSparseEdge(sourceNode, targetNode);
   
    edge.addUserDatum("converter_name", serviceShortPID,
        new UserDataContainer.CopyAction.Shared());
    edge.addUserDatum("service_pid", serviceCompletePID,
        new UserDataContainer.CopyAction.Shared());
   
    outputGraph.addEdge(edge);
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

     * */
    Edge edge = new DirectedSparseEdge(sourceNode, targetNode);
   
    edge.addUserDatum("converter_name", serviceShortPID,
        new UserDataContainer.CopyAction.Shared());
    edge.addUserDatum("service_pid", serviceCompletePID,
        new UserDataContainer.CopyAction.Shared());
   
    outputGraph.addEdge(edge);
  }

View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

          }
          if (!outgoingLabels.isEmpty())
          {
            // add a transition
            DirectedSparseEdge edge = new DirectedSparseEdge(v,rejectVertex);
            edge.addUserDatum(JUConstants.LABEL, outgoingLabels, UserData.CLONE);
            g.addEdge(edge);
          }
        }
      }
    }
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

    for(DirectedSparseEdge e:(Set<DirectedSparseEdge>)g.getEdges())
    {
      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;
  }
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

          }
          if (!outgoingLabels.isEmpty())
          {
            // add a transition
            DirectedSparseEdge edge = new DirectedSparseEdge(v,rejectVertex);
            edge.addUserDatum(JUConstants.LABEL, outgoingLabels, UserData.CLONE);
            g.addEdge(edge);
          }
        }
      }
    }
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

    for(DirectedSparseEdge e:(Set<DirectedSparseEdge>)g.getEdges())
    {
      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;
  }
View Full Code Here

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseEdge.addUserDatum()

    Iterator<DirectedSparseEdge> inEdges = q.getInEdges().iterator();
    Set<DirectedSparseEdge> removeEdges = new HashSet<DirectedSparseEdge>();
    while(inEdges.hasNext()){
      DirectedSparseEdge e = inEdges.next();
      DirectedSparseEdge eDash = new DirectedSparseEdge(e.getSource(), qDash);
      eDash.addUserDatum(JUConstants.LABEL, e.getUserDatum(JUConstants.LABEL), UserData.CLONE);
      if(!e.getSource().getSuccessors().contains(qDash))
        model.addEdge(eDash);
      else{
        Edge existing = findEdge(e.getSource(), qDash);
        Set<String> labels = (Set<String>)existing.getUserDatum(JUConstants.LABEL);// KIRR: if you use UserData.SHARED, you do not need to copy the result back using put
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.