|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.ic.net.MacAddress
public class MacAddress
This class represents a 48-bit hardware MAC (Medium Access Control Layer) address. The 48-bit address is comprised of 3 double octets, each double octet representing 16 bits (e.g. ffff). Single octet (e.g. NN-NN-NN-NN-NN-NN) and double octet (e.g. NNNN.NNNN.NNNN) formats are both supported.
| Field Summary | |
|---|---|
static Hexadecimal |
MAX_DOUBLE_OCTET_RANGE
|
static Hexadecimal |
MIN_DOUBLE_OCTET_RANGE
|
| Constructor Summary | |
|---|---|
MacAddress()
Constructs an empty Mac Address (i.e. |
|
MacAddress(java.lang.String macAddress)
Constructs a Mac Address based on either an octet or double octet string. |
|
| Method Summary | |
|---|---|
Hexadecimal |
getDoubleOctet1()
Gets the first double octet. |
Hexadecimal |
getDoubleOctet2()
Gets the second double octet. |
Hexadecimal |
getDoubleOctet3()
Gets the third double octet. |
boolean |
getUppercase()
Returns whether the toString method will return upper case or not. |
static void |
main(java.lang.String[] args)
Test driver. |
void |
setDoubleOctet1(Hexadecimal doubleOctet1)
Sets the first double octet. |
void |
setDoubleOctet2(Hexadecimal doubleOctet2)
Sets the second double octet. |
void |
setDoubleOctet3(Hexadecimal doubleOctet3)
Sets the third double octet. |
void |
setDoubleOctetAddress(java.lang.String doubleOctet)
Sets the Mac Address based on a double octet string representation (e.g. |
void |
setOctetAddress(java.lang.String doubleOctet)
Sets the Mac Address based on an octet string representation (e.g. |
void |
setUppercase(boolean uppercase)
Determines whether the toString return value will be in upper case or lower case. |
java.lang.String |
toDoubleOctetString()
Returns a string representation of this Mac Address. |
java.lang.String |
toOctetString()
Returns a string representation of this Mac Address. |
java.lang.String |
toString()
Returns a string representation of this Mac Address. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Hexadecimal MIN_DOUBLE_OCTET_RANGE
public static final Hexadecimal MAX_DOUBLE_OCTET_RANGE
| Constructor Detail |
|---|
public MacAddress()
public MacAddress(java.lang.String macAddress)
macAddress - The string representation of the mac address.
java.lang.NumberFormatException - if the string can't be converted to a MacAddress.| Method Detail |
|---|
public void setDoubleOctetAddress(java.lang.String doubleOctet)
throws java.lang.NumberFormatException
doubleOctet - the double octet address.
java.lang.NumberFormatException - if the string can't be converted to a MacAddress.
public void setOctetAddress(java.lang.String doubleOctet)
throws java.lang.NumberFormatException
doubleOctet - the double octet address.
java.lang.NumberFormatException - if the string can't be converted to a MacAddress.
public void setDoubleOctet1(Hexadecimal doubleOctet1)
throws java.lang.NumberFormatException
doubleOctet1 - The first double octet.
java.lang.NumberFormatException - if the hexadecimal value is out of range.public Hexadecimal getDoubleOctet1()
public void setDoubleOctet2(Hexadecimal doubleOctet2)
throws java.lang.NumberFormatException
doubleOctet2 - The second double octet.
java.lang.NumberFormatException - if the hexadecimal value is out of range.public Hexadecimal getDoubleOctet2()
public void setDoubleOctet3(Hexadecimal doubleOctet3)
throws java.lang.NumberFormatException
doubleOctet3 - The third double octet.
java.lang.NumberFormatException - if the hexadecimal value is out of range.public Hexadecimal getDoubleOctet3()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toOctetString()
public java.lang.String toDoubleOctetString()
public void setUppercase(boolean uppercase)
uppercase - Set to true for upper case or false for lower case.public boolean getUppercase()
public static void main(java.lang.String[] args)
args - The arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||