Interface ElementSink

All Known Subinterfaces:
ByteEncoder, FileSink, Graph, Layout, Pipe, ProxyPipe, Sink
All Known Implementing Classes:
AbstractGraph, AdjacencyListGraph, AnnotatedSink, AttributePipe, BarnesHutLayout, ByteProxy, DefaultGraph, FileSinkBase, FileSinkBaseFiltered, FileSinkDGS, FileSinkDGSFiltered, FileSinkDOT, FileSinkDynamicGML, FileSinkGEXF, FileSinkGEXF2, FileSinkGML, FileSinkGraphML, FileSinkImages, FileSinkSVG, FileSinkTikZ, FileSinkUnstyledSVG, GEXF, GEXFEdges, GEXFNodes, GraphicGraph, GraphListeners, GraphSpells, LinLog, MultiGraph, NetStreamEncoder, PipeAdapter, PipeBase, RMISink, SingleGraph, SinkAdapter, SpringBox, StepCounter, ThreadProxyPipe, VerboseSink, ViewerPipe

public interface ElementSink
Interface to listen at changes in the graph structure.

Graph elements listeners are called each time an element of the graph (node or edge) is added or removed. It is also called for special events like "steps" that introduce the notion of time in graphs.

  • Method Summary

    Modifier and Type Method Description
    void edgeAdded​(String sourceId, long timeId, String edgeId, String fromNodeId, String toNodeId, boolean directed)
    An edge was inserted in graph.
    void edgeRemoved​(String sourceId, long timeId, String edgeId)
    An edge of graph was removed.The nodes the edge connects may already have been removed from the graph.
    void graphCleared​(String sourceId, long timeId)
    The whole graph was cleared.
    void nodeAdded​(String sourceId, long timeId, String nodeId)
    A node was inserted in the given graph.
    void nodeRemoved​(String sourceId, long timeId, String nodeId)
    A node was removed from the graph.
    void stepBegins​(String sourceId, long timeId, double step)
    Since dynamic graphs are based on discrete event modifications, the notion of step is defined to simulate elapsed time between events.
  • Method Details

    • nodeAdded

      void nodeAdded​(String sourceId, long timeId, String nodeId)
      A node was inserted in the given graph.
      Parameters:
      sourceId - Identifier of the graph where the node was added.
      nodeId - Identifier of the added node.
    • nodeRemoved

      void nodeRemoved​(String sourceId, long timeId, String nodeId)
      A node was removed from the graph.
      Parameters:
      sourceId - Identifier of the graph where the node will be removed.
      nodeId - Identifier of the removed node.
    • edgeAdded

      void edgeAdded​(String sourceId, long timeId, String edgeId, String fromNodeId, String toNodeId, boolean directed)
      An edge was inserted in graph.
      Parameters:
      sourceId - Identifier of the graph where the edge was added.
      edgeId - Identifier of the added edge.
      fromNodeId - Identifier of the first node of the edge.
      toNodeId - Identifier of the second node of the edge.
      directed - If true, the edge is directed.
    • edgeRemoved

      void edgeRemoved​(String sourceId, long timeId, String edgeId)
      An edge of graph was removed.The nodes the edge connects may already have been removed from the graph.
      Parameters:
      sourceId - The graph where the edge will be removed.
      edgeId - The edge that will be removed.
    • graphCleared

      void graphCleared​(String sourceId, long timeId)
      The whole graph was cleared. All the nodes, edges and attributes of the graph are removed.
      Parameters:
      sourceId - The graph cleared.
    • stepBegins

      void stepBegins​(String sourceId, long timeId, double step)

      Since dynamic graphs are based on discrete event modifications, the notion of step is defined to simulate elapsed time between events. So a step is a event that occurs in the graph, it does not modify it but it gives a kind of timestamp that allow the tracking of the progress of the graph over the time.

      This kind of event is useful for dynamic algorithms that listen to the dynamic graph and need to measure the time in the graph's evolution.

      Parameters:
      sourceId - Identifier of the graph where the step starts.
      timeId - A numerical value that may give a timestamp to track the evolution of the graph over the time.