Interface ILcdEditableGraph<N,E>

All Superinterfaces:
ILcdGraph<N,E>
All Known Implementing Classes:
TLcdGraph, TLcdPartitionedGraph

public interface ILcdEditableGraph<N,E> extends ILcdGraph<N,E>
An ILcdEditableGraph is a graph to which nodes and edges can be added or removed.
Since:
5.1
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEdge(E aEdge, N aStartNode, N aEndNode, int aFireEventMode)
    Adds an edge to this graph, connecting the two given nodes.
    void
    addNode(N aNode, int aFireEventMode)
    Adds a node to this graph.
    boolean
    canAddEdge(E aEdge, N aStartNode, N aEndNode)
    Returns true if the given edge can be added to this graph, false otherwise.
    boolean
    canAddNode(N aNode)
    Returns true if the given node can be added to this graph, false otherwise.
    boolean
    Returns true if the given edge can be removed from this graph, false otherwise.
    boolean
    Returns true if the given node can be removed from this graph, false otherwise.
    void
    clear(int aFireEventMode)
    Clears the graph; all edges and nodes are removed.
    void
    edgeChanged(E aEdge, int aEventMode)
    This method should be called when the given edge has changed.
    void
    edgesChanged(Vector<E> aEdges, int aEventMode)
    This method should be called when the given edges have changed.
    void
    Fires all the collected graph changes, i.e., all graph events that have been generated using the the ILcdFireEventMode.FIRE_LATER mode, after the previous call to fireCollectedGraphChanges().
    void
    nodeChanged(N aNode, int aEventMode)
    This method should be called when the given node has changed.
    void
    nodesChanged(Vector<N> aNodes, int aEventMode)
    This method should be called when the given nodes have changed.
    removeEdge(E aEdge, int aFireEventMode)
    Removes an edge from this graph.
    void
    removeEdges(int aFireEventMode)
    Removes all edges from this graph - nodes will remain in the graph.
    removeNode(N aNode, int aFireEventMode)
    Removes a node from this graph.
  • Method Details

    • canAddNode

      boolean canAddNode(N aNode)
      Returns true if the given node can be added to this graph, false otherwise. More specifically, a node can be added to this graph if the following conditions are met:
      • the node is not null
      • the node is not yet part of this graph
      • the node satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
      Parameters:
      aNode - the node to be verified.
      Returns:
      true if the node can be added to this graph, false otherwise.
    • addNode

      void addNode(N aNode, int aFireEventMode)
      Adds a node to this graph.
      Parameters:
      aNode - the node to be added to this graph.
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canAddNode(aNode) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • canAddEdge

      boolean canAddEdge(E aEdge, N aStartNode, N aEndNode)
      Returns true if the given edge can be added to this graph, false otherwise. More specifically, an edge can be added to this graph if the following conditions are met:
      • none of the arguments is null
      • the edge is not yet part of this graph
      • both nodes are part of this graph
      • the edge satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
      Parameters:
      aEdge - the edge to be verified.
      aStartNode - the first node that should be connected by the given edge.
      aEndNode - the second node that should be connected by the given edge.
      Returns:
      true if the edge can be added to this graph, false otherwise.
    • addEdge

      void addEdge(E aEdge, N aStartNode, N aEndNode, int aFireEventMode)
      Adds an edge to this graph, connecting the two given nodes.
      Parameters:
      aEdge - the edge to be added to this graph.
      aStartNode - the first node that should be connected by the given edge.
      aEndNode - the second node that should be connected by the given edge.
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canAddEdge(aEdge, aStartNode, aEndNode) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • canRemoveNode

      boolean canRemoveNode(N aNode)
      Returns true if the given node can be removed from this graph, false otherwise. More specifically, a node can be remove from this graph if the following conditions are met:
      • the node is not null
      • the node is part of this graph
      • there are no edges in this graph, connected to the node
      Parameters:
      aNode - the node to be verified.
      Returns:
      true if the node can be removed from this graph, false otherwise.
    • removeNode

      N removeNode(N aNode, int aFireEventMode)
      Removes a node from this graph.
      Parameters:
      aNode - the node to be removed from this graph.
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canRemoveNode(aNode) - Note: this validation is potentially expensive, and should be avoided whenever possible.
      Returns:
      the node that was removed from the graph.
    • canRemoveEdge

      boolean canRemoveEdge(E aEdge)
      Returns true if the given edge can be removed from this graph, false otherwise. More specifically, a edge can be remove from this graph if the following conditions are met:
      • the edge is not null
      • the edge is part of this graph
      Parameters:
      aEdge - the edge to be verified.
      Returns:
      true if the edge can be removed from this graph, false otherwise.
    • removeEdge

      E removeEdge(E aEdge, int aFireEventMode)
      Removes an edge from this graph.
      Parameters:
      aEdge - the edge to be removed from this graph.
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canRemoveEdge(aEdge) - Note: this validation is potentially expensive, and should be avoided whenever possible.
      Returns:
      the edge which was removed from the graph.
    • removeEdges

      void removeEdges(int aFireEventMode)
      Removes all edges from this graph - nodes will remain in the graph.
      Parameters:
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
    • clear

      void clear(int aFireEventMode)
      Clears the graph; all edges and nodes are removed.
      Parameters:
      aFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
    • fireCollectedGraphChanges

      void fireCollectedGraphChanges()
      Fires all the collected graph changes, i.e., all graph events that have been generated using the the ILcdFireEventMode.FIRE_LATER mode, after the previous call to fireCollectedGraphChanges(). Note that a fireCollectedGraphChanges() call is made whenever a graph event is generated in the ILcdFireEventMode.FIRE_NOW, to guarantee the correct order of the events.
    • nodeChanged

      void nodeChanged(N aNode, int aEventMode)
      This method should be called when the given node has changed.
      Preconditions:
      containsPartition(aNode) - Note: this validation is potentially expensive, and should be avoided whenever possible.
      Parameters:
      aNode - the node that has changed.
      aEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
    • nodesChanged

      void nodesChanged(Vector<N> aNodes, int aEventMode)
      This method should be called when the given nodes have changed.
      Parameters:
      aNodes - a vector containing the nodes that have changed.
      aEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      for each node object in the given vector should hold that: containsPartition(node) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • edgeChanged

      void edgeChanged(E aEdge, int aEventMode)
      This method should be called when the given edge has changed.
      Parameters:
      aEdge - the edge that has changed.
      aEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      containsBoundaryEdge(aEdge) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • edgesChanged

      void edgesChanged(Vector<E> aEdges, int aEventMode)
      This method should be called when the given edges have changed.
      Parameters:
      aEdges - a vector containing the edges that have changed.
      aEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      for each edge object in the given vector should hold that: containsBoundaryEdge(edge) - Note: this validation is potentially expensive, and should be avoided whenever possible.