net.floodlightcontroller.topology
Class NodePortTuple
java.lang.Object
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
Constructor Summary |
NodePortTuple(long nodeId,
int portId)
Creates a NodePortTuple |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
nodeId
protected long nodeId
portId
protected int portId
NodePortTuple
public NodePortTuple(long nodeId,
int portId)
- Creates a NodePortTuple
- Parameters:
nodeId
- The DPID of the switchportId
- The port of the switch
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>