gov.nist.antd.merlin.protocol.discovery
Class NeighbourTable

java.lang.Object
  |
  +--gov.nist.antd.merlin.protocol.discovery.NeighbourTable

public class NeighbourTable
extends java.lang.Object

This class represents a table of neighbours.

 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

Nested Class Summary
 class NeighbourTable.NeighbourEntry
          Inner class to represent an entry
 
Field Summary
private  java.util.Vector table
          Vector of entries
 
Constructor Summary
NeighbourTable()
          Constructor
 
Method Summary
 void addNeighbor(NeighbourTable.NeighbourEntry entry)
          Add entry in the table.
 void addNeighbour(int localPort, int neighbNodeId, int neighbourPortId, int direction)
          Add entry in the table
 java.util.Vector getEntriesOfNeighbourNode(int nodeId)
          Get the entries that match the neighbor node Id
 NeighbourTable.NeighbourEntry getEntryOfLocalPort(int localport)
          Get the entry that match the local port
 void printTable()
          print the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

private java.util.Vector table
Vector of entries

Constructor Detail

NeighbourTable

public NeighbourTable()
Constructor

Method Detail

addNeighbour

public void addNeighbour(int localPort,
                         int neighbNodeId,
                         int neighbourPortId,
                         int direction)
Add entry in the table

Parameters:
localPort - The local port ID
neighbNodeId - The neighbour node ID
neighbourPortId - The neighbour port ID
direction - Directionality of the link

addNeighbor

public void addNeighbor(NeighbourTable.NeighbourEntry entry)
Add entry in the table.

Parameters:
entry - The NeighbourEntry to add.

getEntryOfLocalPort

public NeighbourTable.NeighbourEntry getEntryOfLocalPort(int localport)
Get the entry that match the local port

Parameters:
localport - The local port we want to have information
Returns:
the entry that matches the local port

getEntriesOfNeighbourNode

public java.util.Vector getEntriesOfNeighbourNode(int nodeId)
Get the entries that match the neighbor node Id

Parameters:
nodeId - The neighbor node Id we want to have the entries
Returns:
the entries that match the local port

printTable

public void printTable()
print the table