50 рядки
1,5 КіБ
Java
50 рядки
1,5 КіБ
Java
package model;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
public class Chat {
|
|
|
|
/*** ATTRIBUTS ***/
|
|
private int localUser_portTCP;
|
|
private int remoteUser_portTCP;
|
|
private ArrayList<RemoteUser> remoteUsersChatList = new ArrayList<RemoteUser>(); // listes des utilisateurs sur ce chat
|
|
|
|
/**
|
|
* Constructor of Chat (local)
|
|
* @parametres
|
|
* @param remoteUser : remoteUser => référence de l'utilisateur distant
|
|
* @param localUser_portTCP : int => le numéro de port TCP d'écoute de la conversation de l'utilisateur local
|
|
* @param remoteUser_portTCP : int => le numéro de port TCP d'écoute de la conversation de l'utilisateur distant
|
|
* @description
|
|
* <p>
|
|
*
|
|
* </p>
|
|
*/
|
|
public Chat(RemoteUser rm,int localUser_portTCP,int remoteUser_portTCP) {
|
|
this.localUser_portTCP = localUser_portTCP;
|
|
this.remoteUser_portTCP = remoteUser_portTCP;
|
|
remoteUsersChatList.add(rm);
|
|
}
|
|
|
|
/*** GETTERS ***/
|
|
public int getLocalUser_portTCP() {
|
|
return localUser_portTCP;
|
|
}
|
|
public int getRemoteUser_portTCP() {
|
|
return remoteUser_portTCP;
|
|
}
|
|
public ArrayList<RemoteUser> getRemoteUsersChatList() {
|
|
return remoteUsersChatList;
|
|
}
|
|
|
|
/*** SETTERS ***/
|
|
public void setLocalUser_portTCP(int localUser_portTCP) {
|
|
this.localUser_portTCP = localUser_portTCP;
|
|
}
|
|
public void setRemoteUser_portTCP(int remoteUser_portTCP) {
|
|
this.remoteUser_portTCP = remoteUser_portTCP;
|
|
}
|
|
public void setRemoteUsersChatList(ArrayList<RemoteUser> remoteUsersChatList) {
|
|
this.remoteUsersChatList = remoteUsersChatList;
|
|
}
|
|
}
|