org.limitless.nmc.Client
Class MuAddress

java.lang.Object
  extended by org.limitless.nmc.Client.MuAddress

public class MuAddress
extends java.lang.Object

This class represents the address of a MUCK - both the hostname and port. The hostname is stored in an unresolved form, and only resolved when something asks for an InetAddress. Note that this is an IMMUTABLE class!

Author:
Brian Jones, Nicholas Pilon

Field Summary
private  java.lang.String hostname
          The hostname of the Mu.
private  int port
          The port the Mu is running on.
 
Constructor Summary
MuAddress(java.net.InetAddress address, int port)
          Create a MuAddress by reverse-resolving the provided InetAddress.
MuAddress(java.lang.String hostName, int port)
          Create a MuAddress from the given hostname and port.
MuAddress(java.lang.String hostName, java.lang.String port)
          Create a MuAddress from the given hostname and parsing an integer out of the provided port string.
 
Method Summary
 java.net.InetAddress getAddress()
          Resolves the provided hostname into an InetAddress and returns that.
 java.lang.String getHostname()
          Access method for the hostname.
 int getPort()
          Access method for the port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hostname

private final java.lang.String hostname
The hostname of the Mu.


port

private final int port
The port the Mu is running on.

Constructor Detail

MuAddress

public MuAddress(java.net.InetAddress address,
                 int port)
Create a MuAddress by reverse-resolving the provided InetAddress.


MuAddress

public MuAddress(java.lang.String hostName,
                 int port)
Create a MuAddress from the given hostname and port.


MuAddress

public MuAddress(java.lang.String hostName,
                 java.lang.String port)
          throws java.lang.NumberFormatException
Create a MuAddress from the given hostname and parsing an integer out of the provided port string.

Throws:
java.lang.NumberFormatException
Method Detail

getAddress

public final java.net.InetAddress getAddress()
                                      throws java.net.UnknownHostException
Resolves the provided hostname into an InetAddress and returns that.

Throws:
java.net.UnknownHostException

getHostname

public java.lang.String getHostname()
Access method for the hostname.


getPort

public int getPort()
Access method for the port. Doesn't need to be final, I don't think.



Copyright © 1995, 2004 Limitless Knowledge Association, All Rights Reserved.