net.floodlightcontroller.topology
Class NodePortTuple

java.lang.Object
  extended by net.floodlightcontroller.topology.NodePortTuple
All Implemented Interfaces:
java.lang.Comparable<NodePortTuple>

public class NodePortTuple
extends java.lang.Object
implements java.lang.Comparable<NodePortTuple>

A NodePortTuple is similar to a SwitchPortTuple but it only stores IDs instead of references to the actual objects.

Author:
srini

Field Summary
protected  long nodeId
           
protected  int portId
           
 
Constructor Summary
NodePortTuple(long nodeId, int portId)
          Creates a NodePortTuple
 
Method Summary
 int compareTo(NodePortTuple obj)
           
 boolean equals(java.lang.Object obj)
           
 long getNodeId()
           
 int getPortId()
           
 int hashCode()
           
 void setNodeId(long nodeId)
           
 void setPortId(int portId)
           
 java.lang.String toKeyString()
          API to return a String value formed wtih NodeID and PortID The portID is a 16-bit field, so mask it as an integer to get full positive value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeId

protected long nodeId

portId

protected int portId
Constructor Detail

NodePortTuple

public NodePortTuple(long nodeId,
                     int portId)
Creates a NodePortTuple

Parameters:
nodeId - The DPID of the switch
portId - The port of the switch
Method Detail

getNodeId

public long getNodeId()

setNodeId

public void setNodeId(long nodeId)

getPortId

public int getPortId()

setPortId

public void setPortId(int portId)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toKeyString

public java.lang.String toKeyString()
API to return a String value formed wtih NodeID and PortID The portID is a 16-bit field, so mask it as an integer to get full positive value

Returns:

compareTo

public int compareTo(NodePortTuple obj)
Specified by:
compareTo in interface java.lang.Comparable<NodePortTuple>