org.openflow.util.string
Class DPIDUtil

java.lang.Object
  extended by org.openflow.util.string.DPIDUtil

public class DPIDUtil
extends java.lang.Object

DPIDUtil -- Utility class with DPID related functions

Author:
Glen Gibb

Field Summary
static int DPID_LEN
          Size of an DPID in bytes
 
Constructor Summary
DPIDUtil()
           
 
Method Summary
static java.lang.String dpidToHex(long dpid)
           
static int hexToDec(char h)
           
static long hexToDPID(java.lang.String hex)
           
static void main(java.lang.String[] args)
           
static byte[] toByteArray(long dpid)
          ByteArray -- convert DPID into a byte array
static java.lang.String toShortString(long dpid)
          Returns DPIDUtil.toString() with all occurrences of "00:" removed
static java.lang.String toString(long dpid)
          toString -- convert a DPID into a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DPID_LEN

public static final int DPID_LEN
Size of an DPID in bytes

See Also:
Constant Field Values
Constructor Detail

DPIDUtil

public DPIDUtil()
Method Detail

toByteArray

public static byte[] toByteArray(long dpid)
ByteArray -- convert DPID into a byte array

Parameters:
dpid - DPID to convert
Returns:
byte array representation of DPID

toString

public static java.lang.String toString(long dpid)
toString -- convert a DPID into a string

Parameters:
dpid - DPID to convert
Returns:
String representation of DPID

toShortString

public static java.lang.String toShortString(long dpid)
Returns DPIDUtil.toString() with all occurrences of "00:" removed


dpidToHex

public static java.lang.String dpidToHex(long dpid)

hexToDec

public static int hexToDec(char h)
                    throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

hexToDPID

public static long hexToDPID(java.lang.String hex)
                      throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

main

public static void main(java.lang.String[] args)