com.voytechs.jnetstream.primitive.address
Class MacAddress

java.lang.Object
  extended by com.voytechs.jnetstream.primitive.address.Address
      extended by com.voytechs.jnetstream.primitive.address.MacAddress
All Implemented Interfaces:
java.io.Serializable

public class MacAddress
extends Address

A Class for storing MAC Addresses

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.voytechs.jnetstream.primitive.address.Address
address, debug, DEFAULT_NUMBER_BASE, format, separator
 
Constructor Summary
MacAddress(byte[] address)
          Main constructor taking the array of bytes as the address.
MacAddress(java.lang.String address)
          Constructor taking a String as the address and converting to a byte array.
 
Method Summary
static void main(java.lang.String[] args)
          Test function for MacAddress
 java.lang.String toString()
          Convert to dot notation string representation of the address.
 
Methods inherited from class com.voytechs.jnetstream.primitive.address.Address
AND, AND, byteArrayValue, compare, compare, compareTo, EOR, EOR, equals, getByte, getByte, getRadix, INVERT, INVERT, longToByteArray, OR, OR, parseByteArray, setAddress, setByteArrayAddress, setFormat, setFormat, setRadix, setSeparator, stringValue, toByteArray, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacAddress

public MacAddress(byte[] address)
Main constructor taking the array of bytes as the address. Automatically sets the separator token to ':'

Parameters:
address - array of bytes making up the address.
Throws:
java.lang.IllegalArgumentException - if number of bytes is not 6.

MacAddress

public MacAddress(java.lang.String address)
Constructor taking a String as the address and converting to a byte array.

Parameters:
address - String making up the address.
Throws:
java.lang.IllegalArgumentException - if number of bytes is not 6.
Method Detail

toString

public java.lang.String toString()
Convert to dot notation string representation of the address. If hostname is known then hostname.domain is returned other wise the appropriate numerical representation of the numerical address is returned as a String.

Overrides:
toString in class Address
Returns:
IP address in the dot notation.

main

public static void main(java.lang.String[] args)
Test function for MacAddress

Parameters:
args - command line arguments