com.cinnabarsystems.clm
Class MacAddress

java.lang.Object
  extended by com.cinnabarsystems.clm.MacAddress

public class MacAddress
extends Object

Provides basic utility functions for accessing information about the Ethernet adapters installed on a system, and their MAC addresses. This data is useful if you are using node-locked licenses.


Method Summary
static MacAddress get(int index)
          Returns a MacAddress instance for a single adapter.
 int[] getAddress()
          Returns the raw MAC address of this adapter.
static MacAddress[] getAll()
          Returns information about all of the Ethernet adapters installed in this system.
 String getName()
          Returns the human-readable name of this adapter.
static int getNumAdapters()
          Returns the number of Ethernet adapters installed on this sytem.
static void main(String[] args)
           
 String toString()
          Returns a string representation of this adapter's MAC address, formatted as a simple string of hexadecimal digits.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAddress

public int[] getAddress()
Returns the raw MAC address of this adapter.

Returns:
this adapter's MAC address

getName

public String getName()
Returns the human-readable name of this adapter. The value and interpretation of this data are highly system-dependent. The name is useful for purposes of disambiguation, if the system has multiple adapters installed.

Returns:
this adapter's name

toString

public String toString()
Returns a string representation of this adapter's MAC address, formatted as a simple string of hexadecimal digits.

Overrides:
toString in class Object
Returns:
MAC address as a hex string

getNumAdapters

public static int getNumAdapters()
Returns the number of Ethernet adapters installed on this sytem. Note that this might be 0 if there are no adapters.

Returns:
number of adapters on this system

get

public static MacAddress get(int index)
Returns a MacAddress instance for a single adapter.

Parameters:
index - index of adapter to retrieve
Returns:
the specified MacAddress instance

getAll

public static MacAddress[] getAll()
Returns information about all of the Ethernet adapters installed in this system. The order in which they are returned is system-dependent. Note that this might return a zero-length array, if there are no adapters.

Returns:
array of MacAddress instances for all adpaters present

main

public static void main(String[] args)