com.caucho.util
Class InetNetwork

java.lang.Object
  extended by com.caucho.util.InetNetwork

public class InetNetwork
extends java.lang.Object

Represents an internet network mask.


Constructor Summary
InetNetwork(java.net.InetAddress inetAddress, int subnetBits)
          Create a internet mask.
 
Method Summary
static InetNetwork create(java.lang.String network)
           
 boolean isMatch(java.net.InetAddress inetAddress)
          Returns true if the address is in this network.
 boolean isMatch(java.lang.String address)
          Returns true if the address is in this network.
 java.lang.String toString()
          Return a readable string.
static InetNetwork valueOf(java.lang.String network)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InetNetwork

public InetNetwork(java.net.InetAddress inetAddress,
                   int subnetBits)
Create a internet mask.

Parameters:
inetAddress - the main address
maskIndex - the number of bits to match.
Method Detail

valueOf

public static InetNetwork valueOf(java.lang.String network)
                           throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

create

public static InetNetwork create(java.lang.String network)
                          throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

isMatch

public boolean isMatch(java.net.InetAddress inetAddress)
Returns true if the address is in this network.


isMatch

public boolean isMatch(java.lang.String address)
Returns true if the address is in this network.


toString

public java.lang.String toString()
Return a readable string.

Overrides:
toString in class java.lang.Object