Package org.graphstream.graph

Examples of org.graphstream.graph.IdAlreadyInUseException


  public <T extends Node> T addNode(String id) {
    AbstractNode node = getNode(id);

    if (node != null) {
      if (strictChecking)
        throw new IdAlreadyInUseException("id \"" + id
            + "\" already in use. Cannot create a node.");
      return (T) node;
    }

    node = nodeFactory.newInstance(id, this);
View Full Code Here


  protected <T extends Edge> T addEdge(String edgeId, AbstractNode src,
      String srcId, AbstractNode dst, String dstId, boolean directed) {
    AbstractEdge edge = getEdge(edgeId);
    if (edge != null) {
      if (strictChecking)
        throw new IdAlreadyInUseException("id \"" + edgeId
            + "\" already in use. Cannot create an edge.");
      if ((edge.getSourceNode() == src && edge.getTargetNode() == dst)
          || (!directed && edge.getTargetNode() == src && edge
              .getSourceNode() == dst))
        return (T) edge;
View Full Code Here

TOP

Related Classes of org.graphstream.graph.IdAlreadyInUseException

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.