|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.arakhne.vmutil.MACNumber
public final class MACNumber
A MACNumber is the unique number associated to a network interface.
NetworkInterface| Field Summary | |
|---|---|
static char |
MACNUMBER_SEPARATOR
Character that is used as separator inside MAC addresses. |
static MACNumber |
NULL
Constant ethernet address object which has the "null address". |
| Constructor Summary | |
|---|---|
MACNumber()
Constructs object with "null values" (address of "0:0:0:0:0:0"). |
|
MACNumber(byte[] bytes)
Build a MACNumber from a set of bytes. |
|
MACNumber(String address)
Build a MACNumber from a string representation. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
static Collection<MACNumber> |
getAllAdapters()
Get all of the ethernet addresses associated with the local machine. |
static Map<InetAddress,MACNumber> |
getAllMappings()
Get all of the internet address and ethernet address mappings on the local machine. |
byte[] |
getBytes()
Replies the bytes that compose this MAC Address. |
static MACNumber |
getPrimaryAdapter()
Try to determine the primary ethernet address of the machine. |
static Collection<InetAddress> |
getPrimaryAdapterAddresses()
Try to determine the primary ethernet address of the machine and replies the associated internet addresses. |
int |
hashCode()
|
boolean |
isNull()
Replies if all the MAC address number are equal to zero. |
static String |
join(MACNumber... addresses)
Join the specified MAC numbers to reply a string. |
static MACNumber[] |
parse(String addresses)
Parse the specified string an repleis the corresponding MAC numbers. |
static String[] |
parseAsString(String addresses)
Parse the specified string an repleis the corresponding MAC numbers. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char MACNUMBER_SEPARATOR
public static final MACNumber NULL
This constant can be used when you want a non-null MACAddress object reference, but want a invalid (or null) MAC address contained.
isNull()| Constructor Detail |
|---|
public MACNumber()
public MACNumber(byte[] bytes)
bytes - is the list of bytes from which the address must be built.
IllegalArgumentException - if the byte array does not corresponds to a valid MAC Number.public MACNumber(String address)
address - is the string representation of a MAC address
IllegalArgumentException - if the byte array does not corresponds to a valid MAC Number.toString()| Method Detail |
|---|
public static MACNumber[] parse(String addresses)
addresses - is the string to parse
IllegalArgumentException - is the argument has not the right syntax.public static String[] parseAsString(String addresses)
addresses - is the string to parse
IllegalArgumentException - is the argument has not the right syntax.public static String join(MACNumber... addresses)
addresses - is the list of mac addresses to join.
public static Collection<MACNumber> getAllAdapters()
This method will try and find ALL of the ethernet adapters
which are currently available on the system. This is heavily OS
dependent and may not be supported on all platforms. When not
supported, you should still get back a collection with the primary adapter in it.
getPrimaryAdapter()public static Map<InetAddress,MACNumber> getAllMappings()
This method will try and find ALL of the ethernet adapters
which are currently available on the system. This is heavily OS
dependent and may not be supported on all platforms. When not
supported, you should still get back a collection with the primary adapter in it.
getPrimaryAdapterAddresses()public static MACNumber getPrimaryAdapter()
nullpublic static Collection<InetAddress> getPrimaryAdapterAddresses()
public boolean equals(Object o)
equals in class Objecto -
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic boolean isNull()
true if all the bytes are zero.NULLpublic byte[] getBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||