1 |
/* NetworkInterface.java -- |
/* NetworkInterface.java -- |
2 |
Copyright (C) 2002, 2003 Free Software Foundation, Inc. |
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
85 |
} |
} |
86 |
|
|
87 |
/** |
/** |
88 |
* Returns all available addresses of the network interface |
* Returns all available addresses of the network interface |
89 |
* |
* |
90 |
* If a @see SecurityManager is available all addresses are checked |
* If a @see SecurityManager is available all addresses are checked |
91 |
* with @see SecurityManager::checkConnect() if they are available. |
* with @see SecurityManager::checkConnect() if they are available. |
92 |
* Only <code>InetAddresses</code> are returned where the security manager |
* Only <code>InetAddresses</code> are returned where the security manager |
93 |
* doesn't throw an exception. |
* doesn't throw an exception. |
94 |
* |
* |
95 |
* @return An enumeration of all addresses. |
* @return An enumeration of all addresses. |
96 |
*/ |
*/ |
97 |
public Enumeration getInetAddresses() |
public Enumeration getInetAddresses() |
98 |
{ |
{ |
122 |
} |
} |
123 |
|
|
124 |
/** |
/** |
125 |
* Returns the display name of the interface |
* Returns the display name of the interface |
126 |
* |
* |
127 |
* @return The display name of the interface |
* @return The display name of the interface |
128 |
*/ |
*/ |
129 |
public String getDisplayName() |
public String getDisplayName() |
130 |
{ |
{ |
160 |
} |
} |
161 |
|
|
162 |
/** |
/** |
163 |
* Return a network interface by its address |
* Return a network interface by its address |
164 |
* |
* |
165 |
* @param addr The address of the interface to return |
* @param addr The address of the interface to return |
166 |
* |
* |
167 |
* @exception SocketException If an error occurs |
* @return the interface, or <code>null</code> if none found |
168 |
* @exception NullPointerException If the specified addess is null |
* |
169 |
|
* @exception SocketException If an error occurs |
170 |
|
* @exception NullPointerException If the specified addess is null |
171 |
*/ |
*/ |
172 |
public static NetworkInterface getByInetAddress(InetAddress addr) |
public static NetworkInterface getByInetAddress(InetAddress addr) |
173 |
throws SocketException |
throws SocketException |
191 |
} |
} |
192 |
|
|
193 |
/** |
/** |
194 |
* Return an <code>Enumeration</code> of all available network interfaces |
* Return an <code>Enumeration</code> of all available network interfaces |
195 |
* |
* |
196 |
* @exception SocketException If an error occurs |
* @return all interfaces |
197 |
|
* |
198 |
|
* @exception SocketException If an error occurs |
199 |
*/ |
*/ |
200 |
public static Enumeration getNetworkInterfaces() throws SocketException |
public static Enumeration getNetworkInterfaces() throws SocketException |
201 |
{ |
{ |
208 |
} |
} |
209 |
|
|
210 |
/** |
/** |
211 |
* Checks if the current instance is equal to obj |
* Checks if the current instance is equal to obj |
212 |
* |
* |
213 |
* @param obj The object to compare with |
* @param obj The object to compare with |
214 |
|
* |
215 |
|
* @return <code>true</code> if equal, <code>false<code> otherwise |
216 |
*/ |
*/ |
217 |
public boolean equals(Object obj) |
public boolean equals(Object obj) |
218 |
{ |
{ |
225 |
} |
} |
226 |
|
|
227 |
/** |
/** |
228 |
* Returns the hashcode of the current instance |
* Returns the hashcode of the current instance |
229 |
|
* |
230 |
|
* @return the hashcode |
231 |
*/ |
*/ |
232 |
public int hashCode() |
public int hashCode() |
233 |
{ |
{ |
236 |
} |
} |
237 |
|
|
238 |
/** |
/** |
239 |
* Returns a string representation of the interface |
* Returns a string representation of the interface |
240 |
|
* |
241 |
|
* @return the string |
242 |
*/ |
*/ |
243 |
public String toString() |
public String toString() |
244 |
{ |
{ |
258 |
|
|
259 |
return result; |
return result; |
260 |
} |
} |
261 |
} // class NetworkInterface |
} |