481 |
*/ |
*/ |
482 |
public String toString() |
public String toString() |
483 |
{ |
{ |
484 |
StringBuffer sb; |
String host; |
485 |
|
String address = getHostAddress(); |
486 |
|
|
487 |
if (hostName != null) |
if (hostName != null) |
488 |
sb = new StringBuffer (hostName).append ('/'); |
host = hostName; |
489 |
else if (hostname_alias != null) |
else if (hostname_alias != null) |
490 |
sb = new StringBuffer (hostname_alias).append ('/'); |
host = hostname_alias; |
491 |
else |
else |
492 |
sb = new StringBuffer(); |
host = address; |
493 |
|
|
494 |
sb.append (getHostAddress()); |
return host + "/" + address; |
|
return (sb.toString()); |
|
495 |
} |
} |
496 |
|
|
497 |
/** |
/** |
792 |
private static native byte[][] getHostByName (String hostname) |
private static native byte[][] getHostByName (String hostname) |
793 |
throws UnknownHostException; |
throws UnknownHostException; |
794 |
|
|
795 |
private void readResolve () throws ObjectStreamException |
private void readResolve() throws ObjectStreamException |
796 |
{ |
{ |
797 |
// FIXME: implement this |
// FIXME: implement this |
798 |
} |
} |