52 |
*/ |
*/ |
53 |
private static final long serialVersionUID = 5076001401234631237L; |
private static final long serialVersionUID = 5076001401234631237L; |
54 |
|
|
55 |
String hostname; |
/** |
56 |
InetAddress addr; |
* Name of host. |
57 |
int port; |
*/ |
58 |
|
private String hostname; |
59 |
|
|
60 |
|
/** |
61 |
|
* Address of host. |
62 |
|
*/ |
63 |
|
private InetAddress addr; |
64 |
|
|
65 |
|
/** |
66 |
|
* Port of host. |
67 |
|
*/ |
68 |
|
private int port; |
69 |
|
|
70 |
/** |
/** |
71 |
* Constructs an InetSocketAddress instance. |
* Constructs an InetSocketAddress instance. |
135 |
/** |
/** |
136 |
* Test if obj is a <code>InetSocketAddress</code> and |
* Test if obj is a <code>InetSocketAddress</code> and |
137 |
* has the same address and port |
* has the same address and port |
138 |
|
* |
139 |
|
* @param obj The obj to compare this address with. |
140 |
|
* |
141 |
|
* @return True if obj is equal. |
142 |
*/ |
*/ |
143 |
public final boolean equals (Object obj) |
public final boolean equals (Object obj) |
144 |
{ |
{ |
163 |
/** |
/** |
164 |
* Returns the <code>InetAddress</code> or |
* Returns the <code>InetAddress</code> or |
165 |
* <code>null</code> if its unresolved |
* <code>null</code> if its unresolved |
166 |
|
* |
167 |
|
* @return The IP address of this address. |
168 |
*/ |
*/ |
169 |
public final InetAddress getAddress() |
public final InetAddress getAddress() |
170 |
{ |
{ |
173 |
|
|
174 |
/** |
/** |
175 |
* Returns <code>hostname</code> |
* Returns <code>hostname</code> |
176 |
|
* |
177 |
|
* @return The hostname of this address. |
178 |
*/ |
*/ |
179 |
public final String getHostName() |
public final String getHostName() |
180 |
{ |
{ |
183 |
|
|
184 |
/** |
/** |
185 |
* Returns the <code>port</code> |
* Returns the <code>port</code> |
186 |
|
* |
187 |
|
* @return The port of this address. |
188 |
*/ |
*/ |
189 |
public final int getPort() |
public final int getPort() |
190 |
{ |
{ |
193 |
|
|
194 |
/** |
/** |
195 |
* Returns the hashcode of the <code>InetSocketAddress</code> |
* Returns the hashcode of the <code>InetSocketAddress</code> |
196 |
|
* |
197 |
|
* @return The hashcode for this address. |
198 |
*/ |
*/ |
199 |
public final int hashCode() |
public final int hashCode() |
200 |
{ |
{ |
203 |
|
|
204 |
/** |
/** |
205 |
* Checks wether the address has been resolved or not |
* Checks wether the address has been resolved or not |
206 |
|
* |
207 |
|
* @return True if address is unresolved. |
208 |
*/ |
*/ |
209 |
public final boolean isUnresolved() |
public final boolean isUnresolved() |
210 |
{ |
{ |
213 |
|
|
214 |
/** |
/** |
215 |
* Returns the <code>InetSocketAddress</code> as string |
* Returns the <code>InetSocketAddress</code> as string |
216 |
|
* |
217 |
|
* @return A string represenation of this address. |
218 |
*/ |
*/ |
219 |
public String toString() |
public String toString() |
220 |
{ |
{ |