use of edu.uci.ics.jung.graph.impl.UndirectedSparseEdge in project tdq-studio-se by Talend.
the class GraphBuilder method newEdge.
/**
* DOC scorreia Comment method "newEdge".
*
* @param row
* @param rowIdx
* @param countColumnIndex
* @param vertexFrom
* @param vertexTo
* @return
*/
private Edge newEdge(Object[] row, int rowIdx, final int countColumnIndex, Vertex vertexFrom, Vertex vertexTo) {
final Edge edge = graph.addEdge(new UndirectedSparseEdge(vertexFrom, vertexTo));
// $NON-NLS-1$
String fullRow = StringUtils.join(row, " , ");
edge.addUserDatum(GraphBuilder.E_ROWNUM_KEY, rowIdx, UserData.CLONE);
// TODO remove this line ?
edge.addUserDatum(GraphBuilder.E_WEIGHT_KEY, getIntegerValue(row[countColumnIndex]), UserData.CLONE);
edge.addUserDatum(E_LABEL_KEY, fullRow, UserData.SHARED);
edgeWeight.setNumber(edge, getIntegerValue(row[countColumnIndex]));
return edge;
}
Aggregations