Interface ILcdPartitionedGraph<N,E>

All Superinterfaces:
ILcdGraph<N,E>
All Known Subinterfaces:
ILcdLimitedEditablePartitionedGraph<N,E>
All Known Implementing Classes:
TLcdLimitedEditablePartitionedGraph, TLcdPartitionedGraph

public interface ILcdPartitionedGraph<N,E> extends ILcdGraph<N,E>
An ILcdPartitionedGraph is an ILcdGraph which is composed of partitions. Since it is an ILcdGraph, it should respect all invariants as stated in the ILcdGraph documentation, especially those concerning the uniqueness of a node or edge in a graph.

The following terms are used in the context of partitioned graphs:

  • a partition of a partitioned graph is a graph that is directly part of that graph. A partition A that is contained in a partitioned graph B that is itself a partition contained in another partitioned graph C, is thus not considered as a partition of C.

  • the internal edges (or just 'edges') of a graph - partitioned or not - are all the edges that have their start and end node both contained in that graph.

  • the boundary edges of a partition are all edges that have one of their nodes contained in that partition, and the other one in another partition of the partitioned graph in which the partition is contained.

  • the boundary nodes of a partition are all nodes that are part of that partition and are connected to at least one boundary edge of that partition.

  • the boundary graph of a partitioned graph is the graph that contains all boundary edges and boundary nodes of all its partitions.
Partitioned graphs should handle graph events as follows:
  • a TLcdGraphChangedEvent, fired by one of its child partitions, should be propagated further (i.e., a new TLcdGraphChangedEvent should be generated, with the same parameters, except for the source), since each modification to a child partition is also an identical modification to the partitioned graph as a whole.
  • if one of the child partitions is a partitioned graph itself, a TLcdPartitionedGraphChangedEvent, fired by this child, should not be propagated further, as the child's internal structure (whether it is a partitioned graph or not) is made abstraction of by this graph.
Since:
5.1
  • Method Details

    • getPartitions

      Enumeration<ILcdGraph<N,E>> getPartitions()
      Returns an Enumeration containing all partitions of this graph.
      Returns:
      an Enumeration containing all the partitions of this graph.
    • containsPartition

      boolean containsPartition(ILcdGraph<N,E> aPartition)
      Returns true if the given graph is a partition of this graph, false otherwise.
      Parameters:
      aPartition - the partition to be checked for.
      Returns:
      true if the given graph is a partition of this graph, false otherwise.
      Throws:
      NullPointerException - if aPartition is null.
    • getPartitionForNode

      ILcdGraph<N,E> getPartitionForNode(N aNode)
      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.
      Parameters:
      aNode - the node whose graph should be returned.
      Returns:
      the partition of this graph that contains this node.
      Throws:
      NullPointerException - if the given node is null.
    • getPartitionForEdge

      ILcdGraph<N,E> getPartitionForEdge(E aEdge)
      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.
      Parameters:
      aEdge - the edge whose graph should be returned.
      Returns:
      the partition of this graph that contains this edge.
      Throws:
      IllegalArgumentException - if the given edge is not part of this graph or the given edge is a boundary edge.
      NullPointerException - if the given edge is null.
    • getBoundaryGraph

      ILcdGraph<N,E> getBoundaryGraph()
      Returns the boundary graph of this graph.
      Returns:
      the boundary graph of this graph.
    • getBoundaryEdges

      Enumeration<E> getBoundaryEdges(ILcdGraph<N,E> aPartition)
      Returns an enumeration containing all boundary edges of the given partition.
      Parameters:
      aPartition - the partition to which the boundary edges should be connected.
      Returns:
      an enumeration containing all boundary edges of the given partition.
      Throws:
      NullPointerException - if the given graph is null.
      IllegalArgumentException - if the given graph is not a partition of this partitioned graph.
    • getBoundaryNodes

      Enumeration<N> getBoundaryNodes(ILcdGraph<N,E> aPartition)
      Returns an enumeration containing all boundary nodes of the given partition.
      Parameters:
      aPartition - the partition from which the boundary should be part.
      Returns:
      an enumeration containing all boundary nodes of the given partition.
      Throws:
      NullPointerException - if the given graph is null.
      IllegalArgumentException - if the given graph is not a partition of this partitioned graph.
    • addPartitionedGraphListener

      void addPartitionedGraphListener(ILcdPartitionedGraphListener<N,E> aPartitionedGraphListener)
      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.
      Parameters:
      aPartitionedGraphListener - the graph listener to be registered with this graph.
      Throws:
      NullPointerException - if the given listener is null.
    • removePartitionedGraphListener

      void removePartitionedGraphListener(ILcdPartitionedGraphListener<N,E> aPartitionedGraphListener)
      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.
      Parameters:
      aPartitionedGraphListener - the graph listener to be unregistered from this graph.
      Throws:
      NullPointerException - if the given listener is null.
      IllegalArgumentException - if the given listener is not currently registered as a listener of this graph.