SK.gnome.dwarf.tcpip
Class InetHost

java.lang.Object
  extended bySK.gnome.dwarf.tcpip.InetHost

public class InetHost
extends java.lang.Object

This class represents a range of Internet hosts.

It may represent either a single host, a subnet or a domain, and may be used to filter out the java.net.InetAddress objects.

The ranges may be in one of the following formats:


Field Summary
static int ALL
          This constant represents a range of all internet hosts.
static int DOMAIN
          This constant represents a domain-based range.
static int IPADDR
          This constant represents an IP-based range.
protected  java.lang.String range
          The host range string.
protected  boolean single
          Whether this range represents a single host or a subnet/domain.
protected  int type
          The host range type.
 
Constructor Summary
InetHost(java.lang.String range)
          Creates a new InetHost with the given range.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getRange()
          Returns the host range string.
 int getType()
          Returns the host range type.
 int hashCode()
           
 boolean implies(java.net.InetAddress addr)
          Tests whether the given address is within the range represented by this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IPADDR

public static final int IPADDR
This constant represents an IP-based range.

See Also:
Constant Field Values

DOMAIN

public static final int DOMAIN
This constant represents a domain-based range.

See Also:
Constant Field Values

ALL

public static final int ALL
This constant represents a range of all internet hosts.

See Also:
Constant Field Values

range

protected java.lang.String range
The host range string.


type

protected int type
The host range type.


single

protected boolean single
Whether this range represents a single host or a subnet/domain.

Constructor Detail

InetHost

public InetHost(java.lang.String range)
Creates a new InetHost with the given range.

The range string may be specified as follows:

Parameters:
range - the host range
Method Detail

getRange

public java.lang.String getRange()
Returns the host range string.

It returns the value of the range field.

Returns:
the host range string

getType

public int getType()
Returns the host range type.

It returns the value of the type field.

Returns:
the host range type

implies

public boolean implies(java.net.InetAddress addr)
Tests whether the given address is within the range represented by this object.

Parameters:
addr - the internet address to check
Returns:
true if the given address is within the range represented by this object, false otherwise

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.