com.maplesoft.client
Class HostInfo

java.lang.Object
  |
  +--com.maplesoft.client.HostInfo

public class HostInfo
extends java.lang.Object

Stores the required host connection information for connection to Server. Copyright 2001 Waterloo Maple Inc


Constructor Summary
HostInfo()
          Constructs a default HostInfo with host set to localhost and the port=14444.
HostInfo(java.lang.String sHost)
          Create Hostinfo for specified host
HostInfo(java.lang.String sHost, int iPort)
          Create Hostinfo for specified host and port
 
Method Summary
static HostInfo getDefaultHostInfo()
          Returns a HostInfo object representing the server that was established by the setDefaultHostInfo method.
 java.lang.String getHost()
          Returns the host that object represents
 int getPort()
          Returns the port number for this host
static void setDefaultHostInfo(java.lang.String host)
          Creates a HostInfo object containing the default host to connect to and uses the DEFAULTPORT.
static void setDefaultHostInfo(java.lang.String host, int port)
          Creates a HostInfo object containing the default host and port to comnect to.
 void setHost(java.lang.String sHost)
          Set a new host specification
 void setPort(int iPort)
          Changes the port number for this host
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostInfo

public HostInfo()
Constructs a default HostInfo with host set to localhost and the port=14444.

HostInfo

public HostInfo(java.lang.String sHost)
Create Hostinfo for specified host
Parameters:
sHost - should be name of a valid server e.g. abc.com

HostInfo

public HostInfo(java.lang.String sHost,
                int iPort)
Create Hostinfo for specified host and port
Parameters:
sHost - should be name of a valid server e.g. abc.com
iPort - port number that server is listeninig on
Method Detail

setHost

public void setHost(java.lang.String sHost)
Set a new host specification
Parameters:
sHost - name of vaild server
Returns:
void

getHost

public java.lang.String getHost()
Returns the host that object represents
Returns:
The String representing the host name

setPort

public void setPort(int iPort)
Changes the port number for this host
Parameters:
iPort - - the port number
Returns:
void

getPort

public int getPort()
Returns the port number for this host
Returns:
The port number

getDefaultHostInfo

public static HostInfo getDefaultHostInfo()
Returns a HostInfo object representing the server that was established by the setDefaultHostInfo method.
Returns:
a HostInfo object with server and port.

setDefaultHostInfo

public static void setDefaultHostInfo(java.lang.String host,
                                      int port)
Creates a HostInfo object containing the default host and port to comnect to.
Parameters:
host - The name of the host (i.e. server) computer
port - The TCPIP port to communicate to the host

setDefaultHostInfo

public static void setDefaultHostInfo(java.lang.String host)
Creates a HostInfo object containing the default host to connect to and uses the DEFAULTPORT.
Parameters:
host - The name of the host (i.e. server) computer