com.lukasfeiler.ipconfig
Class IPAddress

java.lang.Object
  extended bycom.lukasfeiler.util.Int
      extended bycom.lukasfeiler.ipconfig.IPAddress

public class IPAddress
extends Int

An IPv4 Address.


Constructor Summary
IPAddress(int i)
          Constructor that takes the IP address as an int value as an argument.
IPAddress(java.lang.String s)
          Constructor that takes the IP address in dottet-quad notation as an argument.
 
Method Summary
 void matchesNetmask(Netmask netmask)
          Returns whether this IP address matches the netmask passad as argument.
 
Methods inherited from class com.lukasfeiler.util.Int
allBitsSet, getBit, getOctet, getOctets, intValue, toBitString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IPAddress

public IPAddress(java.lang.String s)
          throws IPConfigException,
                 InvalidIntOctetException
Constructor that takes the IP address in dottet-quad notation as an argument.

Parameters:
s - A string in the dottet-quad notation (e.g. 192.168.1.10).

IPAddress

public IPAddress(int i)
Constructor that takes the IP address as an int value as an argument.

Method Detail

matchesNetmask

public void matchesNetmask(Netmask netmask)
                    throws IPConfigException
Returns whether this IP address matches the netmask passad as argument. The netmask does not match if all bits of the host part of the IP address are set either to 0 or to 1. Exception: all bits of the netmask are set (the netmask is 255.255.255.255)

Throws:
IPConfigException