Package org.graphstream.graph

Examples of org.graphstream.graph.Node


      } catch (ClassCastException e) {
        fail();
      }

      try {
        Node nodeA;

        nodeA = edge.getNode0();
        nodeA = edge.getSourceNode();
        nodeA = edge.getNode1();
        nodeA = edge.getTargetNode();
View Full Code Here


          error(e1.toString());
          return;
        }

        g.addSink(nsc);
        Node node0 = g.addNode("node0");
        Edge edge = g.addEdge("edge", "node0", "node1", true);
        node0.addAttribute("nodeAttribute", 0);
        node0.changeAttribute("nodeAttribute", 1);
        node0.removeAttribute("nodeAttribute");
        edge.addAttribute("edgeAttribute", 0);
        edge.changeAttribute("edgeAttribute", 1);
        edge.removeAttribute("edgeAttribute");
        g.addAttribute("graphAttribute", 0);
        g.changeAttribute("graphAttribute", 1);
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.graphstream.graph.Graph#removeNode(int)
   */
  public <T extends Node> T removeNode(int index) {
    Node node = getNode(index);

    if (node == null) {
      if (strictChecking)
        throw new ElementNotFoundException("Node #" + index
            + " not found. Cannot remove it.");
View Full Code Here

   *
   * @see org.graphstream.graph.Graph#removeEdge(java.lang.String,
   * java.lang.String)
   */
  public <T extends Edge> T removeEdge(String from, String to) {
    Node fromNode = getNode(from);
    Node toNode = getNode(to);

    if (fromNode == null || toNode == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            "Cannot remove the edge. The node \"%s\" does not exist",
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.graphstream.graph.Graph#removeEdge(int, int)
   */
  public <T extends Edge> T removeEdge(int fromIndex, int toIndex) {
    Node fromNode = getNode(fromIndex);
    Node toNode = getNode(toIndex);

    if (fromNode == null || toNode == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            "Cannot remove the edge. The node #%d does not exist",
View Full Code Here

    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();
View Full Code Here

TOP

Related Classes of org.graphstream.graph.Node

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.