org.apache.commons.net.util
Class SubnetUtils

java.lang.Object
  extended by org.apache.commons.net.util.SubnetUtils

public class SubnetUtils
extends Object

A class that performs some subnet calculations given a network address and a subnet mask.

Since:
2.0
Author:
See Also:
http://www.faqs.org/rfcs/rfc1519.html

Nested Class Summary
 class SubnetUtils.SubnetInfo
          Convenience container for subnet summary information.
 
Constructor Summary
SubnetUtils(String cidrNotation)
          Constructor that takes a CIDR-notation string, e.g.
SubnetUtils(String address, String mask)
          Constructor that takes two dotted decimal addresses.
 
Method Summary
 SubnetUtils.SubnetInfo getInfo()
          Return a SubnetUtils.SubnetInfo instance that contains subnet-specific statistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubnetUtils

public SubnetUtils(String cidrNotation)
Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16"

Parameters:
cidrNotation - A CIDR-notation string, e.g. "192.168.0.1/16"

SubnetUtils

public SubnetUtils(String address,
                   String mask)
Constructor that takes two dotted decimal addresses.

Parameters:
address - An IP address, e.g. "192.168.0.1"
mask - A dotted decimal netmask e.g. "255.255.0.0"
Method Detail

getInfo

public final SubnetUtils.SubnetInfo getInfo()
Return a SubnetUtils.SubnetInfo instance that contains subnet-specific statistics

Returns:


Copyright © 1997-2008 The Apache Software Foundation. All Rights Reserved.