gov.nist.antd.optical.util
Class LinkUtil

java.lang.Object
  |
  +--gov.nist.antd.optical.util.LinkUtil

public class LinkUtil
extends java.lang.Object

This class contains tools for OpticalLink, Fiber and lambda objects.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Constructor Summary
private LinkUtil()
          Private constructor to avoid instantiation
 
Method Summary
static boolean areSameAttachedNodes(OpticalLink link1, OpticalLink link2)
          Check if 2 links connect the same nodes
static int[] getNodeIDs(_link link)
          Determines the Nodes the link is attached to.
static ONIC getONIC(OpticalLink link, int nodeID)
          get the onic attached to the link in the host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkUtil

private LinkUtil()
Private constructor to avoid instantiation

Method Detail

getNodeIDs

public static int[] getNodeIDs(_link link)
Determines the Nodes the link is attached to.

Parameters:
link - the link whose nodes has to be determined.
Returns:
and Array of int that contains the ID's of the Nodes. The Array does not specify any direction.

getONIC

public static ONIC getONIC(OpticalLink link,
                           int nodeID)
get the onic attached to the link in the host.

Parameters:
link - The OpticalLink that should be connected to the node
nodeID - The ID of the node.
Returns:
the ONIC or null if invalid nodeID.

areSameAttachedNodes

public static boolean areSameAttachedNodes(OpticalLink link1,
                                           OpticalLink link2)
Check if 2 links connect the same nodes

Parameters:
link1 - The first link
link2 - The second link
Returns:
True if they connect the same nodes