/** * It returns the sum of the <code>characteristic</code> given value in the * Edges of the path. * * @param characteristic * The characteristic. * @return Sum of the characteristics. */ public Double getPathWeight(String characteristic) { double d = 0; for (Edge l : edgePath) { d += (Double) l.getAttribute(characteristic, Number.class); } return d; }
events.post(from, GraphEvents.ADD_EDGE_ATTR, graphId, sourceTime.newEvent(), edge.getId(), key, edge.getAttribute(key)); Thread.yield();
for (String key : edge.getAttributeKeySet()) edgeAttributeAdded(graphId, timeId++, edgeId, key, edge.getAttribute(key));
public void replay(String sourceId) { for (String key : getAttributeKeySet()) sendGraphAttributeAdded(sourceId, key, getAttribute(key)); for (int i = 0; i < getNodeCount(); i++) { Node node = getNode(i); String nodeId = node.getId(); sendNodeAdded(sourceId, nodeId); if (node.getAttributeCount() > 0) for (String key : node.getAttributeKeySet()) sendNodeAttributeAdded(sourceId, nodeId, key, node.getAttribute(key)); } for (int i = 0; i < getEdgeCount(); i++) { Edge edge = getEdge(i); String edgeId = edge.getId(); sendEdgeAdded(sourceId, edgeId, edge.getNode0().getId(), edge .getNode1().getId(), edge.isDirected()); if (edge.getAttributeCount() > 0) for (String key : edge.getAttributeKeySet()) sendEdgeAttributeAdded(sourceId, edgeId, key, edge.getAttribute(key)); } } }
events.post(from, GraphEvents.ADD_EDGE_ATTR, graphId, sourceTime.newEvent(), edge.getId(), key, edge.getAttribute(key)); Thread.yield();
/** * It returns the sum of the <code>characteristic</code> given value in the * Edges of the path. * * @param characteristic * The characteristic. * @return Sum of the characteristics. */ public Double getPathWeight(String characteristic) { double d = 0; for (Edge l : edgePath) { d += (Double) l.getAttribute(characteristic, Number.class); } return d; }
for (String key : edge.getAttributeKeySet()) sendEdgeAttributeAdded(sourceId, edgeId, key, edge.getAttribute(key));
e.addAttribute(key, edge.getAttribute(key));
public void edgeAttributeRemoved(String sourceId, long timeId, String edgeId, String attribute) { Event e; e = new AttributeRemoved(ElementType.EDGE, edgeId, attribute, g .getEdge(edgeId).getAttribute(attribute)); events.add(e); }
for (String key : edge.getAttributeKeySet()) edgeAttributeAdded(graphId, timeId++, edgeId, key, edge.getAttribute(key));
e.addAttribute(key, edge.getAttribute(key));
public void edgeAttributeChanged(String sourceId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue) { Event e; e = new AttributeChanged(ElementType.EDGE, edgeId, attribute, newValue, g.getEdge(edgeId).getAttribute(attribute)); events.add(e); }
for (String key : edge.getAttributeKeySet()) sendEdgeAttributeAdded(sourceId, edgeId, key, edge.getAttribute(key));
for (String key : edge.getAttributeKeySet()) { listeners.sendEdgeAttributeAdded(id, edge.getId(), key, edge.getAttribute(key));
public void edgeAttributeChanged(String sourceId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue) { Event e; e = new AttributeChanged(ElementType.EDGE, edgeId, attribute, newValue, g.getEdge(edgeId).getAttribute(attribute)); events.add(e); }
public void replay(String sourceId) { for (String key : getAttributeKeySet()) sendGraphAttributeAdded(sourceId, key, getAttribute(key)); for (int i = 0; i < getNodeCount(); i++) { Node node = getNode(i); String nodeId = node.getId(); sendNodeAdded(sourceId, nodeId); if (node.getAttributeCount() > 0) for (String key : node.getAttributeKeySet()) sendNodeAttributeAdded(sourceId, nodeId, key, node.getAttribute(key)); } for (int i = 0; i < getEdgeCount(); i++) { Edge edge = getEdge(i); String edgeId = edge.getId(); sendEdgeAdded(sourceId, edgeId, edge.getNode0().getId(), edge .getNode1().getId(), edge.isDirected()); if (edge.getAttributeCount() > 0) for (String key : edge.getAttributeKeySet()) sendEdgeAttributeAdded(sourceId, edgeId, key, edge.getAttribute(key)); } } }
for (String key : edge.getAttributeKeySet()) { listeners.sendEdgeAttributeAdded(id, edge.getId(), key, edge.getAttribute(key));
public void edgeAttributeRemoved(String sourceId, long timeId, String edgeId, String attribute) { Event e; e = new AttributeRemoved(ElementType.EDGE, edgeId, attribute, g .getEdge(edgeId).getAttribute(attribute)); events.add(e); }
public void edgeAttributeChanged(String sourceId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue) { if (sinkTime.isNewEvent(sourceId, timeId)) { Edge edge = g.getEdge(edgeId); if (edge != null) { passYourWay = true; if (oldValue == null) oldValue = edge.getAttribute(attribute); try { edge.changeAttribute(attribute, newValue); } finally { passYourWay = false; } sendEdgeAttributeChanged(sourceId, timeId, edgeId, attribute, oldValue, newValue); } } }
public void edgeAttributeChanged(String sourceId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue) { if (sinkTime.isNewEvent(sourceId, timeId)) { Edge edge = g.getEdge(edgeId); if (edge != null) { passYourWay = true; if (oldValue == null) oldValue = edge.getAttribute(attribute); try { edge.changeAttribute(attribute, newValue); } finally { passYourWay = false; } sendEdgeAttributeChanged(sourceId, timeId, edgeId, attribute, oldValue, newValue); } } }