com.lukasfeiler.ipconfig
Class Netmask

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

public class Netmask
extends Int

An IPv4 Netmask.


Constructor Summary
Netmask(int i)
          Constructor that takes the netmask as an int value as an argument.
Netmask(java.lang.String s)
          Constructor that takes the netmask in dottet-quad notation as an argument.
 
Method Summary
 void validate()
          Throws a NonContiniousNetmaskException if this netmask is not valid (is not continious)
 void validate(IPAddress ip1, IPAddress ip2)
          Throws an IPAddressesNotInSameSubnetException if the two IP addresses are not in the same subnet specified by this netmask.
 
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

Netmask

public Netmask(java.lang.String s)
        throws InvalidIntOctetException,
               com.lukasfeiler.ipconfig.IPException,
               IPConfigException
Constructor that takes the netmask in dottet-quad notation as an argument.

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

Netmask

public Netmask(int i)
        throws com.lukasfeiler.ipconfig.IPException
Constructor that takes the netmask as an int value as an argument.

Method Detail

validate

public void validate(IPAddress ip1,
                     IPAddress ip2)
              throws IPConfigException
Throws an IPAddressesNotInSameSubnetException if the two IP addresses are not in the same subnet specified by this netmask.

Throws:
IPConfigException

validate

public void validate()
              throws NonContiniousNetmaskException
Throws a NonContiniousNetmaskException if this netmask is not valid (is not continious)

Throws:
NonContiniousNetmaskException