com.h3c.sdn.misc.net

## Class BroadcastTree

- java.lang.Object
- - com.h3c.sdn.misc.net.BroadcastTree

- All Implemented Interfaces:
    TopologyTree

      public class BroadcastTree
      extends Object
      implements TopologyTree

  Represents the destination rooted tree for a node in cluster.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BroadcastTree()`
    `BroadcastTree(HashMap<DataPathId,Link> nexthoplinks, HashMap<DataPathId,Integer> cost)` Creates a Tree representing all next hop links and cost.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTreeLink(DataPathId myNode, Link link)` Adds a node and associated Link to the tree.
    `int` | `getCost(DataPathId dataPathId)` Provides cost associated a node in the tree.
    `HashMap<DataPathId,Integer>` | `getCosts()` Provides All nodes and associated cost in the tree.
    `HashMap<DataPathId,Link>` | `getLinks()` Provides All nodes and associated Links in the tree.
    `Link` | `getTreeLink(DataPathId node)` Gives the Link associated to given node in the tree.
    `String` | `toDebugString()` Detailed insight into the current tree.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BroadcastTree

          public BroadcastTree()

    - #### BroadcastTree

          public BroadcastTree(HashMap<DataPathId,Link> nexthoplinks,
                       HashMap<DataPathId,Integer> cost)

      Creates a Tree representing all next hop links and cost.
      Parameters:
        `nexthoplinks` - Map of next hop nodes and associated link
        `cost` - Map of nodes and associated cost

  - ### Method Detail

    - #### getTreeLink

          public Link getTreeLink(DataPathId node)

      Gives the Link associated to given node in the tree.
      Specified by:
        `getTreeLink` in interface `TopologyTree`
      Parameters:
        `node` - Id of the device in the Tree
      Returns:
        Link

    - #### getCost

          public int getCost(DataPathId dataPathId)

      Provides cost associated a node in the tree.
      Specified by:
        `getCost` in interface `TopologyTree`
      Parameters:
        `dataPathId` - Id of the device
      Returns:
        Cost

    - #### getLinks

          public HashMap<DataPathId,Link> getLinks()

      Provides All nodes and associated Links in the tree.
      Specified by:
        `getLinks` in interface `TopologyTree`
      Returns:
        Map of nodes and its Link

    - #### addTreeLink

          public void addTreeLink(DataPathId myNode,
                         Link link)

      Adds a node and associated Link to the tree.
      Parameters:
        `myNode` - Id of the device to be added to tree
        `link` - Link associated to the new node to be added

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toDebugString

          public String toDebugString()

      Detailed insight into the current tree.
      Returns:
        debug string

    - #### getCosts

          public HashMap<DataPathId,Integer> getCosts()

      Provides All nodes and associated cost in the tree.
      Specified by:
        `getCosts` in interface `TopologyTree`
      Returns:
        Map of nodes and its cost

Copyright © 2014. All Rights Reserved.