edu.colorado.cs.ns2.animation
Class LinksElement

java.lang.Object
  extended by edu.colorado.cs.ns2.animation.LinksElement

public class LinksElement
extends java.lang.Object

This class stores the NS2 link latency and the two nodes which define the link's endpoints. This data is useful for implementing the simulation animation.

Author:
Kevin Bauer, Pushkar Sambhoos.

Field Summary
private  int latency
          The link's latency as defined when the link is created.
private  int node1
          A link's first endpoint.
private  int node2
          A link's second endpoint.
 
Constructor Summary
LinksElement(int latency, int node1, int node2)
          Three argument constructor.
 
Method Summary
 int getLatency()
          Get latency of the Link in milliseconds.
 int getNode1()
          Get the first node's identifier attached to the Link.
 int getNode2()
          Get the second node's identifier attached to the Link.
 void setLatency(int latency)
          Set latency of the link in ms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

latency

private int latency
The link's latency as defined when the link is created.


node1

private int node1
A link's first endpoint.


node2

private int node2
A link's second endpoint.

Constructor Detail

LinksElement

public LinksElement(int latency,
                    int node1,
                    int node2)
Three argument constructor.

Parameters:
latency - The link's latency.
node1 - The link's first endpoint.
node2 - The link's second endpoint.
Method Detail

getLatency

public int getLatency()
Get latency of the Link in milliseconds.

Returns:
- The link's latency in ms.

setLatency

public void setLatency(int latency)
Set latency of the link in ms

Parameters:
latency - - A new latency in ms.

getNode1

public int getNode1()
Get the first node's identifier attached to the Link.

Returns:
- The first node's identifier attached to the Link.

getNode2

public int getNode2()
Get the second node's identifier attached to the Link.

Returns:
- The second node's identifier attached to the link.