org.neo4j.helpers
Class HostnamePort

java.lang.Object
  extended by org.neo4j.helpers.HostnamePort

public class HostnamePort
extends Object

Represents a hostname and port, optionally with a port range. Examples: myhost, myhost:1234, myhost:1234-1240, :1234, :1234-1240


Constructor Summary
HostnamePort(String hostnamePort)
           
HostnamePort(String host, int port)
           
HostnamePort(String host, int portFrom, int portTo)
           
 
Method Summary
 String getHost()
          The host part, or null if not given.
 String getHost(String defaultHost)
           
 int getPort()
          The first port, or 0 if no port was given.
 int[] getPorts()
          The port range as two ints.
 boolean isRange()
           
 boolean matches(URI toMatch)
           
 String toString()
           
 String toString(String defaultHost)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HostnamePort

public HostnamePort(String hostnamePort)
             throws IllegalArgumentException
Throws:
IllegalArgumentException

HostnamePort

public HostnamePort(String host,
                    int port)

HostnamePort

public HostnamePort(String host,
                    int portFrom,
                    int portTo)
Method Detail

getHost

public String getHost()
The host part, or null if not given.

Returns:

getHost

public String getHost(String defaultHost)

getPorts

public int[] getPorts()
The port range as two ints. If only one port given, then both ints have the same value. If no port range is given, then the array has {0,0} as value.

Returns:

getPort

public int getPort()
The first port, or 0 if no port was given.

Returns:

isRange

public boolean isRange()

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(String defaultHost)

matches

public boolean matches(URI toMatch)


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.