HostAndPortpublic class HostAndPort extends Object implements SerializableRepresents a host and a port in a convenient package that also
accepts a convenient constructor. |
Fields Summary |
---|
public static final long | serialVersionUID | protected String | mHost | protected int | mPort | private boolean | secure |
Constructors Summary |
---|
public HostAndPort(String host, int port, boolean secure)
this.mHost = host;
this.mPort = port;
this.secure = secure;
| public HostAndPort(HostAndPort rhs)
this(rhs.mHost, rhs.mPort, rhs.secure);
| public HostAndPort(String host, int port)
this(host, port, false);
| public HostAndPort(String str)Construct a new HostAndPort from a string of the form "host:port"
StringTokenizer tokenizer =
new StringTokenizer( str, ":", false);
mHost = tokenizer.nextToken();
final String portString = tokenizer.nextToken();
mPort = new Integer( portString ).intValue();
|
Methods Summary |
---|
public java.lang.String | getHost()
return( mHost );
| public int | getPort()
return( mPort );
| public boolean | isSecure()
return this.secure;
| public java.lang.String | toString()
return( mHost + ":" + mPort );
|
|