|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.netsim.addresses.MACAddress
public class MACAddress
This class is an MACAddress that uses a six byte representation divided by semicolons. e.g. ef:01:12:55:4f:02
| Field Summary | |
|---|---|
private byte[] |
address
|
| Constructor Summary | |
|---|---|
MACAddress()
Constructs a new MACAddress with the Value 00:00:00:00:00:00 |
|
MACAddress(byte m0,
byte m1,
byte m2,
byte m3,
byte m4,
byte m5)
Constructs a new MACAddress with the Value m0:m1:m2:m3:m4:m5 |
|
MACAddress(String address)
Constructs a new MACAddress form a String. |
|
| Method Summary | |
|---|---|
static MACAddress |
broadcastAddress()
gets the MAC broadcast address |
private int |
compareTo(MACAddress address,
int part)
Starts comparing recursively this Address with address from the part'th byte on. |
int |
compareTo(Object arg0)
|
static MACAddress |
createRandomAddress()
Creates a random MAC Address. |
boolean |
equals(IAddress address)
Tests if an address is equal to this address. |
private int |
getPart(int part)
|
private char |
hexLowerChar(byte b)
|
private char |
hexUpperChar(byte b)
|
String |
toString()
Converts this MACAddress into the semicolon separated String format xx:xx:xx:xx:xx:xx |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private byte[] address
| Constructor Detail |
|---|
public MACAddress()
public MACAddress(byte m0,
byte m1,
byte m2,
byte m3,
byte m4,
byte m5)
m0 - first byte of the Addressm1 - second byte of the Addressm2 - third byte of the Addressm3 - fourth byte of the Addressm4 - fifth byte of the Addressm5 - sixth byte of the Addresspublic MACAddress(String address)
address - in String representation with colons between the six bytes.| Method Detail |
|---|
public static MACAddress broadcastAddress()
public static MACAddress createRandomAddress()
private int compareTo(MACAddress address,
int part)
address - part - value
public int compareTo(Object arg0)
compareTo in interface ComparableComparable.compareTo(java.lang.Object)public boolean equals(IAddress address)
IAddress
equals in interface IAddressaddress - an address to compare with this Address
IAddress.equals(verinec.netsim.addresses.IAddress)private int getPart(int part)
private char hexLowerChar(byte b)
private char hexUpperChar(byte b)
public String toString()
toString in interface IAddresstoString in class ObjectIAddress.toString()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||