public final class IPAddrRange extends Object implements Iterable<InetAddress>, 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.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBegin() |
byte[] |
getEnd() |
void |
incrementEnd() |
Iterator<InetAddress> |
iterator()
Returns an Iterator object that can be used to step through all the
address encapsulated in the object.
|
BigInteger |
size()
Returns the size of this range.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic byte[] getBegin()
public byte[] getEnd()
public void incrementEnd()
public Iterator<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.
iterator in interface Iterable<InetAddress>Iterator object.InetAddresspublic BigInteger size()
Returns the size of this range.
Copyright © 2022. All rights reserved.