|
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.utils.IPSorter
Convenience class for retrieving the lowest, highest IP address in a given list.
Constructor Summary | |
IPSorter()
|
Method Summary | |
(package private) static long |
byteToLong(byte b)
Converts an 8-bit byte to a 64-bit long integer. |
static long |
convertToLong(byte[] addr)
The convertToLong method takes an array of bytes and shifts them into a long value. |
static long |
convertToLong(java.lang.String ipAddressString)
This method is used to convert a dotted decimal IP address composed of four octets into a long value. |
static java.net.InetAddress |
getLowestInetAddress(java.net.InetAddress[] addresses)
Given a list of IP addresses, return the lowest as determined by the numeric representation and not the alphanumeric string. |
static java.net.InetAddress |
getLowestInetAddress(java.util.List addresses)
Given a list of IP addresses, return the lowest as determined by the numeric representation and not the alphanumeric string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IPSorter()
Method Detail |
static long byteToLong(byte b)
Converts an 8-bit byte to a 64-bit long integer. If the quantity is a sign extended negative number then the value of 256 is added to wrap the conversion into the range of [0..255].
b
- The byte to convert
public static long convertToLong(byte[] addr)
The convertToLong method takes an array of bytes and shifts them into a long value. The bytes at the front of the array are shifted into the MSB of the long as each new byte is added to the LSB of the long. if the array is of sufficent size the first bytes of the array may be shifted out of the returned long.
addr
- The array to convert to a long.
java.lang.IllegalArgumentException
- Thrown if the addr parameter is null.public static long convertToLong(java.lang.String ipAddressString)
ipAddressString
- The dotted decimal address string to convert
java.lang.IllegalArgumentException
- Thrown if the ipAddressString parameter is null.public static java.net.InetAddress getLowestInetAddress(java.net.InetAddress[] addresses)
public static java.net.InetAddress getLowestInetAddress(java.util.List addresses)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |