SK.gnome.dwarf.tcpip
Class InetHostSet

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

public class InetHostSet
extends java.lang.Object

This class represents a set of Internet host ranges.

It groups together more than one InetHost instances, and may be used to filter out the java.net.InetAddress objects.

The set of ranges may be specified as a comma-separated list of individual ranges, like "192.168.0.1, 192.168.1., .domain.com, .trusted.com", for example.


Field Summary
protected  java.util.Set ranges
          The set of InetHost host ranges.
 
Constructor Summary
InetHostSet(java.lang.String ranges)
          Creates a new InetHostSet.
 
Method Summary
 boolean implies(java.net.InetAddress host)
          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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ranges

protected java.util.Set ranges
The set of InetHost host ranges.

Constructor Detail

InetHostSet

public InetHostSet(java.lang.String ranges)
Creates a new InetHostSet.

The ranges set is populated with the InetHost instances created from the ranges argument string.

Parameters:
ranges - the comma-separated list of ranges
Method Detail

implies

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

It returns true if at least one of the contained InetHost instance implies the given address, otherwise returns false.

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

toString

public java.lang.String toString()


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