Class TLcdLimitedEditablePartitionedGraph<N,E>

java.lang.Object
com.luciad.network.graph.partition.TLcdLimitedEditablePartitionedGraph<N,E>
All Implemented Interfaces:
ILcdGraph<N,E>, ILcdLimitedEditablePartitionedGraph<N,E>, ILcdPartitionedGraph<N,E>
Direct Known Subclasses:
TLcdPartitionedGraph

public class TLcdLimitedEditablePartitionedGraph<N,E> extends Object implements ILcdLimitedEditablePartitionedGraph<N,E>
Implementation of ILcdLimitedEditablePartitionedGraph. The getPartitionForNode and getPartitionForEdge methods can be overwritten by subclasses to improve the performance of this graph (e.g. when the partition to which a node belongs can be retrieved based on the geographical location of the node).
Since:
5.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new, empty TLcdLimitedEditablePartitionedGraph.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Adds the given edge to the boundary graph of this partitioned graph.
    void
    Registers the given ILcdGraphListener with this graph.
    void
    addPartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Adds a partition to this graph.
    void
    Registers the given ILcdPartitionedGraphListener with this graph.
    void
    boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    This method should be called when the given boundary edge has changed.
    void
    boundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    This method should be called when the given boundary edges have changed.
    boolean
    canAddBoundaryEdge(E aEdge, N aStartNode, N aEndNode)
    Returns true if the given boundary edge can be added to this partitioned graph, false otherwise.
    boolean
    Returns true if the given partition can be added to this partitioned graph, false otherwise.
    boolean
    Returns true if the given boundary edge can be removed from this graph, false otherwise.
    boolean
    Returns true if the boundary edge connected to the given partition can be removed from this graph, false otherwise.
    boolean
    Returns true if the given partition can be removed from this partitioned graph, false otherwise.
    void
    clear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Clears the graph; all partitions are removed from this graph and the boundary graph is cleared.
    void
    clearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.
    boolean
    containsEdge(E aEdge)
    Returns true if aEdge is contained in this graph, false otherwise.
    boolean
    containsNode(N aNode)
    Returns true if aNode is part of this graph, false otherwise.
    boolean
    Returns true if the given graph is a partition of this graph, false otherwise.
    void
    Fires all the collected graph changes, i.e., all graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call to fireCollectedGraphChanges().
    void
    Fires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call to fireCollectedPartitionedGraphChanges().
    Returns an enumeration containing all boundary edges of the given partition.
    Returns the boundary graph of this graph.
    Returns an enumeration containing all boundary nodes of the given partition.
    Returns an Enumeration containing all edges in this graph.
    getEdges(N aNode)
    Returns an Enumeration containing all edges connected to the given node.
    getEndNode(E aEdge)
    Returns the end node of the given edge in this graph.
    Returns an Enumeration containing all nodes in this graph.
    getOppositeNode(E aEdge, N aNode)
    If aNode is one of the two nodes connected by the given edge in this graph, returns the other node, otherwise throws IllegalArgumentException.
    Returns the partition of this partitioned graph that contains the given edge, or null if the given edge is not part of a partition in this graph.
    Returns the partition of this partitioned graph that contains the given node, or null if the given node is not part of a partition in this graph.
    Returns an Enumeration containing all partitions of this graph.
    getStartNode(E aEdge)
    Returns the start node of the given edge in this graph.
    boolean
    isConnected(E aEdge, N aNode)
    Returns true if aNode is one the nodes to which this edge is connected.
    removeBoundaryEdge(E aEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Removes the given boundary edge from the boundary graph of this partitioned graph.
    removeBoundaryEdges(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Removes all boundary edges that are connected to the given partition.
    void
    Unregisters the given ILcdGraphListener from this graph.
    void
    removePartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
    Removes the given partition from this graph.
    void
    Unregisters the given ILcdPartitionedGraphListener from this graph.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdLimitedEditablePartitionedGraph

      public TLcdLimitedEditablePartitionedGraph()
      Constructs a new, empty TLcdLimitedEditablePartitionedGraph.
  • Method Details

    • canAddBoundaryEdge

      public boolean canAddBoundaryEdge(E aEdge, N aStartNode, N aEndNode)
      Returns true if the given boundary edge can be added to this partitioned graph, false otherwise. More specifically, a boundary edge can be added to this graph if the following conditions are met:
      • the boundary edge is not null
      • the boundary edge is not yet part of this graph
      • the given nodes are both part of this graph
      • the given nodes are part of different partitions
      • the boundary edge satisfies all additional implementation-specific requirements (see the documentation of the implementing class).

      This implementation uses the containsBoundaryEdge method to test whether the given edge is already part of this graph or not, and the getPartitionForNode method to determine in which partition both given nodes are contained.

      Specified by:
      canAddBoundaryEdge in interface ILcdLimitedEditablePartitionedGraph<N,E>
      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 boundary edge can be added to this graph, false otherwise.
    • addBoundaryEdge

      public void addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Adds the given edge to the boundary graph of this partitioned graph.
      Specified by:
      addBoundaryEdge in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aEdge - the edge that should be added.
      aStartNode - the start node of the edge.
      aEndNode - the end node of the edge.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canAddBoundaryEdge(aEdge, aStartNode, aEndNode) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • canRemoveBoundaryEdge

      public boolean canRemoveBoundaryEdge(E aEdge)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Returns true if the given boundary edge can be removed from this graph, false otherwise. More specifically, a boundary edge can be remove from this graph if the following conditions are met:
      • the boundary edge is not null
      • the boundary edge is part of the boundary graph of this partitioned graph
      Specified by:
      canRemoveBoundaryEdge in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aEdge - the boundary edge to be verified.
      Returns:
      true if the boundary edge can be removed from this graph, false otherwise.
    • removeBoundaryEdge

      public E removeBoundaryEdge(E aEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Removes the given boundary edge from the boundary graph of this partitioned graph.
      Specified by:
      removeBoundaryEdge in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aEdge - the boundary edge that should be removed.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canRemoveBoundaryEdge(aEdge) - Note: this validation is potentially expensive, and should be avoided whenever possible.
      Returns:
      the boundary edge that was removed.
    • canRemoveBoundaryEdges

      public boolean canRemoveBoundaryEdges(ILcdGraph<N,E> aPartition)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Returns true if the boundary edge connected to the given partition can be removed from this graph, false otherwise. More specifically, the boundary edges connected to the given partition can be removed from this graph if the following conditions are met:
      • the partition is not null
      • the partition is part of this partitioned graph
      Specified by:
      canRemoveBoundaryEdges in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be verified.
      Returns:
      true if the boundary edges connected to the given partition can be removed from this graph, false otherwise.
    • removeBoundaryEdges

      public Enumeration<E> removeBoundaryEdges(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Removes all boundary edges that are connected to the given partition.
      Specified by:
      removeBoundaryEdges in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition whose boundary edges should be removed.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canRemoveBoundaryEdges(aPartition) - Note: this validation is potentially expensive, and should be avoided whenever possible.
      Returns:
      an enumeration with all edges that have been removed.
    • clearBoundaryGraph

      public void clearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.
      Specified by:
      clearBoundaryGraph in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
    • canAddPartition

      public boolean canAddPartition(ILcdGraph<N,E> aPartition)
      Returns true if the given partition can be added to this partitioned graph, false otherwise. More specifically, a partition can be added to this graph if the following conditions are met:
      • the partition is not null
      • the partition is not yet part of this graph
      • the partition contains no nodes or edges that are already part of this graph
      • the partition satisfies all additional implementation-specific requirements (see the documentation of the implementing class).

      This implementation uses the containsPartition method to determine whether the given partition is already part of this graph or not. The implementation iterates over all nodes and edges, using respectively the containsPartition and containsBoundaryEdge methods to verify that no node or edge is already part of this graph.

      Specified by:
      canAddPartition in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be verified.
      Returns:
      true if the partition can be added to this graph, false otherwise.
    • addPartition

      public void addPartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Adds a partition to this graph.

      From the moment a partition is added to the partitioned graph, the client becomes partly responsible himself for maintaining the invariants of the partitioned graph in which it is contained. More specifically, the user should always check himself whether adding a node or an edge to a partition, will not violate the invariants that each node and edge should be unique within a graph (the partitioned graph it is part of, in this case).

      The most easy way to edit partitions without violating the invariants, is to use the edit methods of the partitioned graph, instead of using the methods of the partition directly. These methods will guarantee that no invariant shall be violated.

      Specified by:
      addPartition in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be added to this graph.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canAddPartition(aPartition) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • canRemovePartition

      public boolean canRemovePartition(ILcdGraph<N,E> aPartition)
      Returns true if the given partition can be removed from this partitioned graph, false otherwise. More specifically, a partition can be removed from this graph if the following conditions are met:
      • the partition is not null
      • the partition is part of this graph
      • there are no boundary edges in this graph, connected to the given partition

      The implementation uses the containsPartition method to determine whether the given partition is part of this graph.

      Specified by:
      canRemovePartition in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be verified.
      Returns:
      true if the partition can be removed from this graph, false otherwise.
    • removePartition

      public void removePartition(ILcdGraph<N,E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Removes the given partition from this graph. A partition can only be removed if there are no connections any more between that partition and the other partitions.

      By removing a partition, modifications to the partition have no influence any more on this graph, and can no longer violate its invariants.

      Specified by:
      removePartition in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be removed from this graph.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      canRemovePartition(aPartition) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • clear

      public void clear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Clears the graph; all partitions are removed from this graph and the boundary graph is cleared. Note that no recursive clearing is done, i.e. all partitions remain unmodified and can still be used on their own. By clearing the graph, modifications to any of these partitions have no influence any more on this graph, and can no longer violate the invariants of this graph.
      Specified by:
      clear in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent. This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
    • fireCollectedPartitionedGraphChanges

      public void fireCollectedPartitionedGraphChanges()
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Fires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call to fireCollectedPartitionedGraphChanges(). Note that afireCollectedPartitionedGraphChanges() call is made whenever a partitioned graph event is generated in the ILcdFireEventMode.FIRE_NOW, to guarantee the correct order of the events.
      Specified by:
      fireCollectedPartitionedGraphChanges in interface ILcdLimitedEditablePartitionedGraph<N,E>
    • boundaryEdgeChanged

      public void boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      This method should be called when the given boundary edge has changed.
      Specified by:
      boundaryEdgeChanged in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aBoundaryEdge - the boundary edge that has changed.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - the mode for sending out the TLcdGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      Preconditions:
      getBoundaryGraph().containsBoundaryEdge(aBoundaryEdge) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • boundaryEdgesChanged

      public void boundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode)
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      This method should be called when the given boundary edges have changed.
      Specified by:
      boundaryEdgesChanged in interface ILcdLimitedEditablePartitionedGraph<N,E>
      Parameters:
      aBoundaryEdges - a vector containing the boundary edges that have changed.
      aPartitionedGraphFireEventMode - the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one of ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
      aGraphFireEventMode - 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 boundaryEdge in the given vector should hold that: getBoundaryGraph().containsBoundaryEdge(boundaryEdge) - Note: this validation is potentially expensive, and should be avoided whenever possible.
    • getPartitions

      public Enumeration<ILcdGraph<N,E>> getPartitions()
      Description copied from interface: ILcdPartitionedGraph
      Returns an Enumeration containing all partitions of this graph.
      Specified by:
      getPartitions in interface ILcdPartitionedGraph<N,E>
      Returns:
      an Enumeration containing all the partitions of this graph.
    • containsPartition

      public boolean containsPartition(ILcdGraph<N,E> aPartition)
      Description copied from interface: ILcdPartitionedGraph
      Returns true if the given graph is a partition of this graph, false otherwise.
      Specified by:
      containsPartition in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to be checked for.
      Returns:
      true if the given graph is a partition of this graph, false otherwise.
    • getPartitionForNode

      public ILcdGraph<N,E> getPartitionForNode(N aNode)
      Description copied from interface: ILcdPartitionedGraph
      Returns the partition of this partitioned graph that contains the given node, or null if the given node is not part of a partition in this graph.
      Specified by:
      getPartitionForNode in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aNode - the node whose graph should be returned.
      Returns:
      the partition of this graph that contains this node.
    • getPartitionForEdge

      public ILcdGraph<N,E> getPartitionForEdge(E aEdge)
      Description copied from interface: ILcdPartitionedGraph
      Returns the partition of this partitioned graph that contains the given edge, or null if the given edge is not part of a partition in this graph. The partitions connected by a boundary edge should be retrieved by calling the getPartitionForNode method with as argument one of the two nodes connected by this edge.
      Specified by:
      getPartitionForEdge in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aEdge - the edge whose graph should be returned.
      Returns:
      the partition of this graph that contains this edge.
    • getBoundaryNodes

      public Enumeration<N> getBoundaryNodes(ILcdGraph<N,E> aPartition)
      Description copied from interface: ILcdPartitionedGraph
      Returns an enumeration containing all boundary nodes of the given partition.
      Specified by:
      getBoundaryNodes in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aPartition - the partition from which the boundary should be part.
      Returns:
      an enumeration containing all boundary nodes of the given partition.
    • getBoundaryEdges

      public Enumeration<E> getBoundaryEdges(ILcdGraph<N,E> aPartition)
      Description copied from interface: ILcdPartitionedGraph
      Returns an enumeration containing all boundary edges of the given partition.
      Specified by:
      getBoundaryEdges in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aPartition - the partition to which the boundary edges should be connected.
      Returns:
      an enumeration containing all boundary edges of the given partition.
    • getBoundaryGraph

      public ILcdGraph<N,E> getBoundaryGraph()
      Description copied from interface: ILcdPartitionedGraph
      Returns the boundary graph of this graph.
      Specified by:
      getBoundaryGraph in interface ILcdPartitionedGraph<N,E>
      Returns:
      the boundary graph of this graph.
    • addPartitionedGraphListener

      public void addPartitionedGraphListener(ILcdPartitionedGraphListener aPartitionedGraphListener)
      Description copied from interface: ILcdPartitionedGraph
      Registers the given ILcdPartitionedGraphListener with this graph. All events generated by this graph afterwards will be sent to the given listener, until it is removed from this graph.
      Specified by:
      addPartitionedGraphListener in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aPartitionedGraphListener - the graph listener to be registered with this graph.
    • removePartitionedGraphListener

      public void removePartitionedGraphListener(ILcdPartitionedGraphListener aPartitionedGraphListener)
      Description copied from interface: ILcdPartitionedGraph
      Unregisters the given ILcdPartitionedGraphListener from this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.
      Specified by:
      removePartitionedGraphListener in interface ILcdPartitionedGraph<N,E>
      Parameters:
      aPartitionedGraphListener - the graph listener to be unregistered from this graph.
    • containsNode

      public boolean containsNode(N aNode)
      Description copied from interface: ILcdGraph
      Returns true if aNode is part of this graph, false otherwise.
      Specified by:
      containsNode in interface ILcdGraph<N,E>
      Parameters:
      aNode - the node to be checked.
      Returns:
      true if aNode is part of the graph, false otherwise.
    • getNodes

      public Enumeration<N> getNodes()
      Description copied from interface: ILcdGraph
      Returns an Enumeration containing all nodes in this graph.
      Specified by:
      getNodes in interface ILcdGraph<N,E>
      Returns:
      an Enumeration containing all nodes in this graph.
    • containsEdge

      public boolean containsEdge(E aEdge)
      Description copied from interface: ILcdGraph
      Returns true if aEdge is contained in this graph, false otherwise.
      Specified by:
      containsEdge in interface ILcdGraph<N,E>
      Parameters:
      aEdge - the edge to be checked
      Returns:
      true if aEdge is part of the graph, false otherwise.
    • getEdges

      public Enumeration<E> getEdges()
      Description copied from interface: ILcdGraph
      Returns an Enumeration containing all edges in this graph.
      Specified by:
      getEdges in interface ILcdGraph<N,E>
      Returns:
      an Enumeration containing all edges in this graph.
    • getEdges

      public Enumeration<E> getEdges(N aNode)
      Returns an Enumeration containing all edges connected to the given node.

      This implementation uses the getPartitionForNode method to determine the partition in which the given node is contained.

      Specified by:
      getEdges in interface ILcdGraph<N,E>
      Parameters:
      aNode - the node whose connected edges should be returned.
      Returns:
      an Enumeration containing all edges connected to the given node.
      Throws:
      IllegalArgumentException - aNode is not part of this graph.
      NullPointerException - if the node is null.
    • getStartNode

      public N getStartNode(E aEdge)
      Returns the start node of the given edge in this graph.

      This implementation uses the getPartitionForEdge method to determine the partition in which the given edge is contained.

      Specified by:
      getStartNode in interface ILcdGraph<N,E>
      Parameters:
      aEdge - the edge whose start node should be returned.
      Returns:
      the start node.
      Throws:
      IllegalArgumentException - aEdge is not part of this graph.
      NullPointerException - if the edge is null.
    • getEndNode

      public N getEndNode(E aEdge)
      Returns the end node of the given edge in this graph.

      This implementation uses the getPartitionForEdge method to determine the partition in which the given edge is contained.

      Specified by:
      getEndNode in interface ILcdGraph<N,E>
      Parameters:
      aEdge - the edge whose end node should be returned.
      Returns:
      the end node.
      Throws:
      IllegalArgumentException - aEdge is not part of this graph.
      NullPointerException - if the edge is null.
    • getOppositeNode

      public N getOppositeNode(E aEdge, N aNode)
      If aNode is one of the two nodes connected by the given edge in this graph, returns the other node, otherwise throws IllegalArgumentException.

      This implementation uses the getPartitionForEdge method to determine the partition in which the given edge is contained.

      Specified by:
      getOppositeNode in interface ILcdGraph<N,E>
      Parameters:
      aEdge - the edge whose opposite node should be returned.
      aNode - one of the two Object's connected by the given edge.
      Returns:
      if aNode is one of the two nodes connected by this edge, returns the other node connected by this edge.
      Throws:
      IllegalArgumentException - aNode is not connected by this edge or aEdge is not part of this graph.
      NullPointerException - if one of the arguments is null.
    • isConnected

      public boolean isConnected(E aEdge, N aNode)
      Returns true if aNode is one the nodes to which this edge is connected.

      This implementation uses the getPartitionForEdge method to determine the partition in which the given edge is contained.

      Specified by:
      isConnected in interface ILcdGraph<N,E>
      Parameters:
      aEdge - the edge whose connectivity should be checked.
      aNode - the node which connectivity should be checked.
      Returns:
      true if aNode is one the nodes to which this edge is connected.
      Throws:
      IllegalArgumentException - aEdge is not part of this graph.
      NullPointerException - if one of the arguments is null.
    • addGraphListener

      public void addGraphListener(ILcdGraphListener<N,E> aGraphListener)
      Description copied from interface: ILcdGraph
      Registers the given ILcdGraphListener with this graph. All events generated by this graph afterwards will be sent to the given listener, until it is removed from this graph.
      Specified by:
      addGraphListener in interface ILcdGraph<N,E>
      Parameters:
      aGraphListener - the graph listener to be registered with this graph.
    • removeGraphListener

      public void removeGraphListener(ILcdGraphListener<N,E> aGraphListener)
      Description copied from interface: ILcdGraph
      Unregisters the given ILcdGraphListener from this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.
      Specified by:
      removeGraphListener in interface ILcdGraph<N,E>
      Parameters:
      aGraphListener - the graph listener to be unregistered from this graph.
    • fireCollectedGraphChanges

      public void fireCollectedGraphChanges()
      Description copied from interface: ILcdLimitedEditablePartitionedGraph
      Fires all the collected graph changes, i.e., all graph events that have been generated using 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.
      Specified by:
      fireCollectedGraphChanges in interface ILcdLimitedEditablePartitionedGraph<N,E>