com.indexdata.utils
Class IpRangeSet

java.lang.Object
  extended by com.indexdata.utils.IpRangeSet

public class IpRangeSet
extends Object

Utility class to test if one IP range set can be considered the superset of another.

A given set -- IP range set A -- is considered to 'enclose' another set -- IP range set B -- if all possible IP numbers in set B is a subset of all possible IP numbers in set A (note).

A IP range set is a space separated list of one or more IP ranges and/or single IP numbers.
An IP range is a hyphen separated list of two IP numbers. Note: Is not guaranteed to handle IP ranges that are split in two with the end-point of one being back-to-back with the start-point of the next.

Author:
Niels Erik Nielsen

Nested Class Summary
 class IpRangeSet.IpRange
           
 
Constructor Summary
IpRangeSet(String ipRanges)
           
 
Method Summary
 boolean encloses(IpRangeSet anotherIpRangeSet)
          Determines if a given IP range set is the subset of this IP range set.
 Iterator<IpRangeSet.IpRange> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IpRangeSet

public IpRangeSet(String ipRanges)
Method Detail

iterator

public Iterator<IpRangeSet.IpRange> iterator()

encloses

public boolean encloses(IpRangeSet anotherIpRangeSet)
Determines if a given IP range set is the subset of this IP range set.

Parameters:
anotherIpRangeSet -
Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.