|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.discovery.IPAddressRange.IPAddressRangeGenerator
This class is used to enumerate or iterate through one contiguous set of IP addresses. The class can either be used as an iterator or as an enumeration. In java 1.2 iterators were introduced and are being used in favor of enumerations in new classes.
Field Summary | |
private long |
m_end
The last address in the range. |
private long |
m_next
The next address in the range. |
Constructor Summary | |
(package private) |
IPAddressRange.IPAddressRangeGenerator(long start,
long end)
Creates a generator object that iterates over the range from start to end, inclusive. |
Method Summary | |
boolean |
hasMoreElements()
Returns true if the enumeration object has more elements remaining. |
boolean |
hasNext()
Returns true if there are more elements in the iteration. |
(package private) static java.net.InetAddress |
make(long addr)
Converts an integer to an InetAdrress object and discards any exceptions. |
java.lang.Object |
next()
Returns the next object in the iteration. |
java.lang.Object |
nextElement()
Returns the next element in the enumeration. |
void |
remove()
The remove method of the iterator interface is considered optional for the implemetor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private long m_next
private final long m_end
Constructor Detail |
IPAddressRange.IPAddressRangeGenerator(long start, long end)
Creates a generator object that iterates over the range from start to end, inclusive.
start
- The start address.end
- The ending address.
java.lang.IllegalArgumentException
- Thrown if the start address is greater than the ending
address.Method Detail |
static java.net.InetAddress make(long addr)
addr
- The 32-bit IP address value, int network order.
public boolean hasMoreElements()
Returns true if the enumeration object has more elements remaining.
hasMoreElements
in interface java.util.Enumeration
public java.lang.Object nextElement()
Returns the next element in the enumeration. If there is no element left in the enumeration an exception will be thrown.
nextElement
in interface java.util.Enumeration
java.util.NoSuchElementException
- Thrown if the collection is exhausted.public boolean hasNext()
Returns true if there are more elements in the iteration.
hasNext
in interface java.util.Iterator
public java.lang.Object next()
Returns the next object in the iteration. If there are no objects left in the iteration an exception will be thrown.
next
in interface java.util.Iterator
java.util.NoSuchElementException
- Thrown if the collection is exhausted.public void remove()
The remove method of the iterator interface is considered optional for the implemetor. For the purposes of this class it is not implemented and will throw an exception.
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- Always thrown by the remove method.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |