Class IPAddrRange

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.net.InetAddress>

    public final class IPAddrRange
    extends java.lang.Object
    implements java.lang.Iterable<java.net.InetAddress>, java.io.Serializable

    The IPAddressRange object is used to encapsulate the starting and ending points of a contiguous IPv4/IPv6 Address range. The class can then generate either an Enumeration or Iterator that can be used to cycle through the range of addresses by the object's user.

    Author:
    Sowmya , Brian Weaver
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getBegin()  
      byte[] getEnd()  
      void incrementEnd()  
      java.util.Iterator<java.net.InetAddress> iterator()
      Returns an Iterator object that can be used to step through all the address encapsulated in the object.
      java.math.BigInteger size()
      Returns the size of this range.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • getBegin

        public byte[] getBegin()
      • getEnd

        public byte[] getEnd()
      • incrementEnd

        public void incrementEnd()
      • iterator

        public java.util.Iterator<java.net.InetAddress> iterator()

        Returns an Iterator object that can be used to step through all the address encapsulated in the object.

        The iterator returns objects of type InetAddressor null if the address is unknown.

        Specified by:
        iterator in interface java.lang.Iterable<java.net.InetAddress>
        Returns:
        a Iterator object.
        See Also:
        InetAddress
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • size

        public java.math.BigInteger size()

        Returns the size of this range.