Package org.graphstream.graph

Examples of org.graphstream.graph.Edge


      return e;
    }

    public <T extends Edge> T getEdge(int index)
        throws IndexOutOfBoundsException {
      Edge e;

      elementLock.lock();
      e = wrappedElement.getEdge(index);
      elementLock.unlock();

      return e == null ? null : this.<T> getEdge(e.getId());
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(String from, String to)
        throws ElementNotFoundException {
      T e;
      Edge se;

      elementLock.lock();
      e = wrappedElement.removeEdge(from, to);
      se = synchronizedEdges.remove(e.getId());
      elementLock.unlock();
View Full Code Here

    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(String id)
        throws ElementNotFoundException {
      T e;
      Edge se;

      elementLock.lock();
      e = wrappedElement.removeEdge(id);
      se = synchronizedEdges.remove(e.getId());
      elementLock.unlock();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(int index) {
      T e;
      Edge se;

      elementLock.lock();
      e = wrappedElement.removeEdge(index);
      se = synchronizedEdges.remove(e.getId());
      elementLock.unlock();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(int fromIndex, int toIndex) {
      T e;
      Edge se;

      elementLock.lock();
      e = wrappedElement.removeEdge(fromIndex, toIndex);
      se = synchronizedEdges.remove(e.getId());
      elementLock.unlock();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(Node node1, Node node2) {
      T e;
      Edge se;

      if (node1 instanceof SynchronizedNode)
        node1 = ((SynchronizedNode) node1).wrappedElement;

      if (node2 instanceof SynchronizedNode)
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Edge> T removeEdge(Edge edge) {
      T e;
      Edge se;

      if (edge instanceof SynchronizedEdge)
        edge = ((SynchronizedEdge) edge).wrappedElement;

      elementLock.lock();
View Full Code Here

    }

    // Replay all edges and their attributes.

    for (Edge edge : graph.getEachEdge()) {
      Edge e = this.graph.addEdge(edge.getId(), edge.getSourceNode()
          .getId(), edge.getTargetNode().getId(), edge.isDirected());

      if (edge.getAttributeKeySet() != null) {
        for (String key : edge.getAttributeKeySet()) {
          e.addAttribute(key, edge.getAttribute(key));
        }
      }
    }
  }
View Full Code Here

   * @return The edge length or -1 if the nodes of the edge have no positions.
   * @throws RuntimeException
   *             If the edge cannot be found.
   */
  public static double edgeLength(Graph graph, String id) {
    Edge edge = graph.getEdge(id);

    if (edge != null)
      return edgeLength(edge);

    throw new RuntimeException("edge '" + id + "' cannot be found");
View Full Code Here

   * .String, long, java.lang.String, java.lang.String, java.lang.Object)
   */
  public void edgeAttributeAdded(String sourceId, long timeId, String edgeId,
      String attribute, Object value) {
    if (sinkTime.isNewEvent(sourceId, timeId)) {
      Edge edge = g.getEdge(edgeId);
      if (edge != null) {
        passYourWay = true;

        try {
          edge.addAttribute(attribute, value);
        } finally {
          passYourWay = false;
        }

        sendEdgeAttributeAdded(sourceId, timeId, edgeId, attribute,
View Full Code Here

TOP

Related Classes of org.graphstream.graph.Edge

Copyright © 2018 www.massapicom. 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.