|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.core.utils.IPSorter
public class IPSorter
Convenience class for retrieving the lowest, highest IP address in a given list.
| Constructor Summary | |
|---|---|
IPSorter()
|
|
| Method Summary | |
|---|---|
static long |
convertToLong(byte[] addr)
The convertToLong method takes an array of bytes and shifts them into a long value. |
static long |
convertToLong(String ipAddressString)
This method is used to convert a dotted decimal IP address composed of four octets into a long value. |
static InetAddress |
getLowestInetAddress(InetAddress[] addresses)
Given a list of IP addresses, return the lowest as determined by the numeric representation and not the alphanumeric string. |
static InetAddress |
getLowestInetAddress(List<InetAddress> 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 |
|---|
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.
IllegalArgumentException - Thrown if the addr parameter is null.public static long convertToLong(String ipAddressString)
ipAddressString - The dotted decimal address string to convert
IllegalArgumentException - Thrown if the ipAddressString parameter is null.public static InetAddress getLowestInetAddress(InetAddress[] addresses)
public static InetAddress getLowestInetAddress(List<InetAddress> addresses)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||