Class IPAddressTool

java.lang.Object
tools.IPAddressTool

public class IPAddressTool extends Object
Provides a class with tools for working with IP addresses, in both strings and as long integers.
Since:
Revision 890
  • Constructor Details

    • IPAddressTool

      public IPAddressTool()
  • Method Details

    • dottedQuadToLong

      public static final long dottedQuadToLong(String dottedQuad) throws RuntimeException
      Converts a dotted-quad IP (127.0.0.1) and turns it into a long integer IP.
      Parameters:
      dottedQuad - The IP address in dotted-quad form.
      Returns:
      The IP as a long integer.
      Throws:
      RuntimeException
    • longToDottedQuad

      public static final String longToDottedQuad(long longIP) throws RuntimeException
      Converts a long integer IP into a dotted-quad IP.
      Parameters:
      longIP - The IP as a long integer.
      Returns:
      The IP as a dotted-quad string.
      Throws:
      RuntimeException