/***********************************************************************

GECCO, a platform for command and control gaming

Copyright (C) 2001 Henrik Bäärnhielm, Andreas Enblom, Niklas
Hallenfur, Karl Hasselström, Henrik Hägerström, Oskar Linde, Jing Fu
Zi and Jon Åslund

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

***********************************************************************/

package gecco.client.dialogs;

/**
 *  A struct containing a hostname and a port.
 *
 * @author     Oskar Linde
 * @author     Andreas Enblom
 * @created    June 27, 2001
 */

public class HostPort {
    /**
     *  Description of the Field
     */
    public String host;
    /**
     *  Description of the Field
     */
    public int port;


    /**
     *  Constructor for the HostPort object
     */
    public HostPort() {
    }


    /**
     *  Constructor for the HostPort object
     *
     * @param  host  Description of Parameter
     * @param  port  Description of Parameter
     */
    public HostPort(String host, int port) {
        setHost(host);
        setPort(port);
    }


    /**
     *  Constructor for the HostPort object
     *
     * @param  hostPort  Description of Parameter
     */
    public HostPort(HostPort hostPort) {
        this(hostPort.getHost(), hostPort.getPort());
    }


    /**
     *  Sets the Host attribute of the HostPort object
     *
     * @param  s  The new Host value
     */
    public void setHost(String s) {
        host = new String(s);
    }


    /**
     *  Sets the Port attribute of the HostPort object
     *
     * @param  i  The new Port value
     */
    public void setPort(int i) {
        port = i;
    }


    /**
     *  Gets the Host attribute of the HostPort object
     *
     * @return    The Host value
     */
    public String getHost() {
        return host;
    }


    /**
     *  Gets the Port attribute of the HostPort object
     *
     * @return    The Port value
     */
    public int getPort() {
        return port;
    }


    /**
     *  Description of the Method
     *
     * @return    Description of the Returned Value
     */
    public String toString() {
        return host + ":" + port;
    }
}
