net.jolsrv2.data
Class AddressBlock

java.lang.Object
  extended by net.jolsrv2.data.AddressBlock

public class AddressBlock
extends java.lang.Object

An address is specified as a sequence of octets of the form head:mid: tail. An address block is an ordered set of addresses sharing the same head and tail, and having individual mids. [address block] is defined by: [address-block] = [num-addr] [head-octet] [head]? [tail-octet]? [tail]? [mid]* The class implements the address block.

Author:
Andreas Schjønhaug

Constructor Summary
AddressBlock()
          Constructor
 
Method Summary
 void add(java.net.InetAddress address)
          The method adds an IP address to the address block
 void calculate()
          Calculates the head and tails of multiple addresses
 java.util.ArrayList<java.net.InetAddress> getAddresses()
          Returns the IP addresses
 byte[] getBytes()
          Returns the bytes of the address block
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressBlock

public AddressBlock()
Constructor

Method Detail

add

public void add(java.net.InetAddress address)
The method adds an IP address to the address block

Parameters:
address -

calculate

public void calculate()
Calculates the head and tails of multiple addresses


getAddresses

public java.util.ArrayList<java.net.InetAddress> getAddresses()
Returns the IP addresses

Returns:
the addresses contained in the address block

getBytes

public byte[] getBytes()
Returns the bytes of the address block

Returns:
the bytes in the address block
See Also:
Message