summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/java/net/InetSocketAddress.java
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2009-07-24 15:17:03 -0700
committerJesse Wilson <jessewilson@google.com>2009-07-24 15:40:01 -0700
commitf5597e626ecf7949d249dea08c1a2964d890ec11 (patch)
treef9f6aab14a81c9f51729e875f721a33ace6e579b /luni/src/main/java/java/net/InetSocketAddress.java
parent0402e94d55d8c3aeec5e4db97ef62aab35f97235 (diff)
downloadlibcore-f5597e626ecf7949d249dea08c1a2964d890ec11.zip
libcore-f5597e626ecf7949d249dea08c1a2964d890ec11.tar.gz
libcore-f5597e626ecf7949d249dea08c1a2964d890ec11.tar.bz2
Integrate luni module (but not tests) to Harmony r772995.
Notable changes - Stripped "@since Android 1.0" from many files. Most files are now 100% the same in Dalvik and Harmony. - AbstractStringBuilder.reverse() supports surrogates - AbstractStringBuilder shares less to waste less memory - Bitset optimized - BufferedInputStream changed to support unsynchronized close() - BufferedOutputStream does flushInternal - BufferedReader supports EBCDIC NEL - Collections.synchronizedList().indexOf() does a copy for more concurrency - Classes in nio module changed: DatagramChannelImpl, SocketChannelImpl and ServerSocketChannelImpl (these depend on internal APIs changed in this update) - DataInputStream/DataOutputStream now use a small buffer to limit the number of times the underlying stream is accessed - Date now has a minutes offset, more efficient toString() - ExposedByteArrayInputStream: new internal class - DeleteOnExit moved to top-level class - FileDescriptor.isValid() now non-native - Float, Double lessThan optimized (fix for compare(-0.0F, 0.0F) still pending) - FileURLConnection now guesses content types from streams - HashMap iterator changes - Hashtable iterator changes - INetworkSystem - removes bind2(), createMulticastSocket, sendStream(), - renames createSocket to createStreamSocket - JarURLConnection rewritten - LinkedHashMap: new iterator - Locale, Currency, TimeZone: now use ICU in Harmony, plain Java in Dalvik - ObjectInputStream: Accessor objects in Harmony, direct native in Dalvik - ProxyClassFile - many changes - String - optimized ascii for toLowerCase, toUpperCase, compare - Timer - rewritten - TreeMap - rewritten - URLClassLoader - new - URLConnection - new guessContentTypeFromStream(), uses org.apache.harmony.awt.www.content to lookup content type handlers
Diffstat (limited to 'luni/src/main/java/java/net/InetSocketAddress.java')
-rw-r--r--luni/src/main/java/java/net/InetSocketAddress.java37
1 files changed, 12 insertions, 25 deletions
diff --git a/luni/src/main/java/java/net/InetSocketAddress.java b/luni/src/main/java/java/net/InetSocketAddress.java
index 6901053..13c10f2 100644
--- a/luni/src/main/java/java/net/InetSocketAddress.java
+++ b/luni/src/main/java/java/net/InetSocketAddress.java
@@ -23,8 +23,6 @@ import java.io.ObjectInputStream;
/**
* This class represents a socket endpoint described by a IP address and a port
* number. It is a concrete implementation of {@code SocketAddress} for IP.
- *
- * @since Android 1.0
*/
public class InetSocketAddress extends SocketAddress {
@@ -40,10 +38,9 @@ public class InetSocketAddress extends SocketAddress {
* Creates a socket endpoint with the given port number {@code port} and the
* wildcard address {@code InetAddress.ANY}. The range for valid port numbers
* is between 0 and 65535 inclusive.
- *
+ *
* @param port
* the specified port number to which this socket is bound.
- * @since Android 1.0
*/
public InetSocketAddress(int port) {
this((InetAddress) null, port);
@@ -54,12 +51,11 @@ public class InetSocketAddress extends SocketAddress {
* {@code address}. The range for valid port numbers is between 0 and 65535
* inclusive. If {@code address} is {@code null} this socket is bound to the
* wildcard address {@code InetAddress.ANY}.
- *
+ *
* @param port
* the specified port number to which this socket is bound.
* @param address
* the specified address to which this socket is bound.
- * @since Android 1.0
*/
public InetSocketAddress(InetAddress address, int port) {
if (port < 0 || port > 65535) {
@@ -79,7 +75,7 @@ public class InetSocketAddress extends SocketAddress {
* hostname {@code host}. The hostname is tried to be resolved and cannot be
* {@code null}. The range for valid port numbers is between 0 and 65535
* inclusive.
- *
+ *
* @param port
* the specified port number to which this socket is bound.
* @param host
@@ -88,14 +84,13 @@ public class InetSocketAddress extends SocketAddress {
* if a {@link SecurityManager} is installed and its {@code
* checkConnect()} method does not allow the resolving of the
* host name.
- * @since Android 1.0
*/
public InetSocketAddress(String host, int port) {
this(host, port, true);
}
/*
- * Internal contructor for InetSocketAddress(String, int) and
+ * Internal constructor for InetSocketAddress(String, int) and
* createUnresolved(String, int);
*/
InetSocketAddress(String host, int port, boolean needResolved) {
@@ -126,7 +121,7 @@ public class InetSocketAddress extends SocketAddress {
* Creates an {@code InetSocketAddress} without trying to resolve the
* hostname into an {@code InetAddress}. The address field is marked as
* unresolved.
- *
+ *
* @param host
* the specified hostname to which this socket is bound.
* @param port
@@ -135,7 +130,6 @@ public class InetSocketAddress extends SocketAddress {
* @throws IllegalArgumentException
* if the hostname {@code host} is {@code null} or the port is
* not in the range between 0 and 65535.
- * @since Android 1.0
*/
public static InetSocketAddress createUnresolved(String host, int port) {
return new InetSocketAddress(host, port, false);
@@ -143,9 +137,8 @@ public class InetSocketAddress extends SocketAddress {
/**
* Gets the port number of this socket.
- *
+ *
* @return the socket endpoint port number.
- * @since Android 1.0
*/
public final int getPort() {
return port;
@@ -153,9 +146,8 @@ public class InetSocketAddress extends SocketAddress {
/**
* Gets the address of this socket.
- *
+ *
* @return the socket endpoint address.
- * @since Android 1.0
*/
public final InetAddress getAddress() {
return addr;
@@ -163,9 +155,8 @@ public class InetSocketAddress extends SocketAddress {
/**
* Gets the hostname of this socket.
- *
+ *
* @return the socket endpoint hostname.
- * @since Android 1.0
*/
public final String getHostName() {
return (null != addr) ? addr.getHostName() : hostname;
@@ -173,10 +164,9 @@ public class InetSocketAddress extends SocketAddress {
/**
* Returns whether this socket address is unresolved or not.
- *
+ *
* @return {@code true} if this socket address is unresolved, {@code false}
* otherwise.
- * @since Android 1.0
*/
public final boolean isUnresolved() {
return addr == null;
@@ -185,9 +175,8 @@ public class InetSocketAddress extends SocketAddress {
/**
* Gets a string representation of this socket included the address and the
* port number.
- *
+ *
* @return the address and port number as a textual representation.
- * @since Android 1.0
*/
@Override
public String toString() {
@@ -204,12 +193,11 @@ public class InetSocketAddress extends SocketAddress {
* Compares two socket endpoints and returns true if they are equal. Two
* socket endpoints are equal if the IP address or the hostname of both are
* equal and they are bound to the same port.
- *
+ *
* @param socketAddr
* the object to be tested for equality.
* @return {@code true} if this socket and the given socket object {@code
* socketAddr} are equal, {@code false} otherwise.
- * @since Android 1.0
*/
@Override
public final boolean equals(Object socketAddr) {
@@ -243,9 +231,8 @@ public class InetSocketAddress extends SocketAddress {
/**
* Gets the hashcode of this socket.
- *
+ *
* @return the appropriate hashcode.
- * @since Android 1.0
*/
@Override
public final int hashCode() {