Class Address

java.lang.Object
com.frostwire.jlibtorrent.Address
All Implemented Interfaces:
Cloneable, Comparable<Address>

public final class Address extends Object implements Comparable<Address>, Cloneable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
    Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    Compare addresses for ordering.
    boolean
    Determine whether the address is a loopback address.
    boolean
    Determine whether the address is a multicast address.
    boolean
    Determine whether the address is unspecified.
    boolean
    Get whether the address is an IP version 4 address.
    boolean
    Get whether the address is an IP version 6 address.
     
    Get the address as a string in dotted decimal format.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Address

      public Address(address addr)
      Parameters:
      addr - the native object
    • Address

      public Address(String ip)
      Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
      Parameters:
      ip - the ip string representation
    • Address

      public Address()
  • Method Details

    • swig

      public address swig()
      Returns:
      native object
    • isV4

      public boolean isV4()
      Get whether the address is an IP version 4 address.
      Returns:
      if it's an IPv4 address
    • isV6

      public boolean isV6()
      Get whether the address is an IP version 6 address.
      Returns:
      if it's an IPv6 address
    • isLoopback

      public boolean isLoopback()
      Determine whether the address is a loopback address.
      Returns:
      if it's a loopback address
    • isUnspecified

      public boolean isUnspecified()
      Determine whether the address is unspecified.
      Returns:
      if it's an unspecified address
    • isMulticast

      public boolean isMulticast()
      Determine whether the address is a multicast address.
      Returns:
      if it's an multicast address
    • compareTo

      public int compareTo(Address o)
      Compare addresses for ordering.
      Specified by:
      compareTo in interface Comparable<Address>
      Parameters:
      o - the other address
      Returns:
      -1, 0 or 1
    • toString

      public String toString()
      Get the address as a string in dotted decimal format.
      Overrides:
      toString in class Object
      Returns:
      string representation
    • clone

      public Address clone()
      Overrides:
      clone in class Object