e.setUserDatum(JUConstants.LABEL, labelSet, UserData.SHARED);
}
public static DirectedSparseGraph buildEVGraph(String graphString)
{
DirectedSparseGraph g = TestFSMAlgo.buildGraph(graphString, "simpleGraph");
g.getEdgeConstraints().clear();
List<Edge> newEdges = new LinkedList();
for(DirectedSparseEdge e:(Set<DirectedSparseEdge>)g.getEdges())
{
Collection<String> labels = (Collection<String>)e.getUserDatum(JUConstants.LABEL);
e.removeUserDatum(JUConstants.LABEL);
Iterator<String> labelIt = labels.iterator();
e.addUserDatum(EDGE, labelIt.next(), UserData.SHARED);
while(labelIt.hasNext())
{
DirectedSparseEdge newEdge = new DirectedSparseEdge(e.getSource(),e.getDest());
newEdge.setUserDatum(EDGE, labelIt.next(), UserData.SHARED);
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);
}