Contact.java
上传用户:w19756388
上传日期:2022-03-11
资源大小:124k
文件大小:3k
源码类别:

IP电话/视频会议

开发平台:

Java

  1. package com.coded.jchat;
  2. /*
  3.  * Copyright (C) 2006 Hassen Ben Tanfous
  4.  * All right reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions
  8.  * are met:
  9.  *
  10.  *  1. Redistributions of source code must retain the above copyright
  11.  * notice, this list of conditions and the following disclaimer.
  12.  *
  13.  *  2. Redistributions in binary form must reproduce the above copyright
  14.  * notice, this list of conditions and the following disclaimer in the
  15.  * documentation and/or other materials provided with the distribution.
  16.  *
  17.  *  3. Neither the name of the Hassen Ben Tanfous nor the names of its contributors
  18.  * may be used to endorse or promote products derived from this software
  19.  * without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22.  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24.  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
  25.  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26.  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27.  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28.  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29.  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30.  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31.  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32.  *
  33.  *
  34.  * Contact.java
  35.  * repr閟ente un contact avec son ip, son port, et son pseudo
  36.  * Date: 31/12/2005
  37.  * @author Hassen Ben Tanfous
  38.  */
  39. public class Contact {
  40.     private String ip, port, pseudo;
  41.     private int iport;
  42.     public Contact (String ip, String port, String pseudo) {
  43.         this.ip = ip;
  44.         this.port = port;
  45.         this.pseudo = pseudo;
  46.         iport = Integer.parseInt (port);
  47.     }
  48.     public Contact (String ip, int port, String pseudo) {
  49.         this (ip, Integer.toString(port), pseudo);
  50.     }
  51.     public void setIP (String ip) {
  52.         this.ip =ip;
  53.     }
  54.     public String getIP () {
  55.         return this.ip;
  56.     }
  57.     public void setPort (String port) {
  58.         this.port = port;
  59.         this.iport = Integer.parseInt (port);
  60.     }
  61.     public void setPort (int port) {
  62.         setPort (Integer.toString (port));
  63.     }
  64.     public String getPort () {
  65.         return this.port;
  66.     }
  67.     public int getPortInt() {
  68.         return iport;
  69.     }
  70.     public void setPseudo (String pseudo) {
  71.         this.pseudo = pseudo;
  72.     }
  73.     public String getPseudo () {
  74.         return pseudo;
  75.     }
  76. }