All Implemented Interfaces:
Comparable<GraphElement>, Attributable, GraphElement, Node

public class MergedNode
extends AdjListNode
A Node implementation that represents several nodes in a coarsening level within MultilevelGraph.
See Also:
AdjListNode, Node
  • Constructor Details

    • MergedNode

      public MergedNode​(Graph g, Set<Node> nodes)
      Create a new MergedNode.
      Parameters:
      g - The Graph that contains this node. Must not be null.
      nodes - The Nodes represented by this node. Must not be null. Note that the collection will not be copied, but is used directly by this instance.
      See Also:
      AdjListNode(Graph)
    • MergedNode

      @Deprecated public MergedNode​(Graph g, CollectionAttribute col)
      Deprecated.
      Create a new MergedNode. It is preferable to use the other constructor and refrain from using addInnerNode(Node).
      Parameters:
      g - The Graph that contains this node. Must not be null.
      See Also:
      AdjListNode(Graph, CollectionAttribute)
    • MergedNode

      @Deprecated public MergedNode​(Graph g)
      Deprecated.
      Create a new MergedNode. It is preferable to use the other constructor and refrain from using addInnerNode(Node).
      Parameters:
      g - The Graph that contains this node. Must not be null.
      See Also:
      AdjListNode(Graph)
  • Method Details

    • getInnerNodes

      public Collection<? extends Node> getInnerNodes()
      Returns:
      the Nodes represented by this MergedNode. The returned value must not be modified (see addInnerNode(Node)).
    • addInnerNode

      @Deprecated public void addInnerNode​(Node node)
      Deprecated.
      Use this method to add a Node to the collection of nodes represented by this MergedNode. It is better to add all inner nodes using the constructor MergedNode(Graph, Set), because otherwise the position has to be recalculated on each change.
      Parameters:
      node - The Node to be added. Must not be null. Must not be already contained in this MergedNode (i.e. not in getInnerNodes()).
    • getWeight

      public int getWeight()
      Returns:
      the number of nodes that the MergedNode represents (other MergedNodes are not counted, just the notes that they in turn represent)