⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverclientdata.java

📁 JAVA实现的聊天工具,可以容纳最多10个用户 1.本系统需要JDK1.5 或更高版本的支持。 2.serverDatabase为服务器端的数据文件. 若使用现有数据,可用帐号:1, 密码
💻 JAVA
字号:
import java.util.*;
public class ServerClientData implements ServerClient{
	private String type;
	//variables for register
	private String name; 
	private String password;	
	private String age;
	private String sex;
	private String mail;
	private String from;
	
	//variables for confirm and send general info
	private String tf;   //true false
	private long id;  //general info
	
	//general info
	private String info;
	
	//send friends id to server
	private List<Long> friendsID;
	private List<String> friendsIP;
	private List<String> friendsName;
	
	private int sendFileKey,receiveFileKey;  //id of a ToFriendFile in ToFriendFileList
	private String fileName;  //name of the file corresponnding to fileKey
	
	//constructor for register
	public ServerClientData(String type,String name,String password,String age,String sex,String mail,String from){
		this.type=type;
		this.name=name;
		this.password=password;
		this.age=age;
		this.sex=sex;
		this.mail=mail;
		this.from=from;
	}
	
	//constructor for confirm register
	public ServerClientData(String type,String tf,long id){
		this.type=type;
		this.tf=tf;
		this.id=id;
	}
	
	//constructor for confirming going on line
	public ServerClientData(String type,String tf,String info){
		this.type=type;
		this.tf=tf;
		this.info=info;
	}
	
	//constructor for general purpose 
	public ServerClientData(String type,String info){
		this.type=type;
		this.info=info;
	}
	
	//constructor for connecting to server(go online)
    public ServerClientData(String type,long id,String password){
    	this.type=type;
    	this.id=id;
    	this.password=password;
    }
    
    //constructor for client quit , inform a friend online
    public ServerClientData(String type,long id){
    	this.type=type;
    	this.id=id;
    }
    
    //for adding or deling friends
    public ServerClientData(String type,long id,List<Long> friends){
    	this.type=type;
    	this.id=id;
    	this.friendsID=friends;
    }
    //for informing deling friends error
    public ServerClientData(String type,String tf,String info,List<Long> friends){
    	this.type=type;
    	this.tf=tf;
    	this.info=info;
    	this.friendsID=friends;
    }
    
    public ServerClientData(String type,List<Long> friendsID,List<String> friendsIP,List<String> friendsName){
    	this.type=type;
    	this.friendsID=friendsID;
    	this.friendsIP=friendsIP;
    	this.friendsName=friendsName;
    }
    
    public ServerClientData(String type,long id,int sendFileKey,String fileName){
    	this.type=type;
    	this.sendFileKey=sendFileKey;
    	this.fileName=fileName;
    	this.id=id;
    }
    
    public ServerClientData(String type,int sendFileKey,int receiveFileKey){
    	this.type=type;
    	this.sendFileKey=sendFileKey;
    	this.receiveFileKey=receiveFileKey;
    }
	
	public String getType(){
		return type;
	}
	
	public String getName(){
		return name;
	}
	
	public String getMail(){
		return mail;
	}
	
	public String getPassword(){
		return password;
	}
	
	public String getAge(){
		return age;
	}
	
	public String getSex(){
		return sex;
	}
	
	public String getFrom(){
		return from;
	}
	
	public String getTF(){
		return tf;
	}
	
	public long getID(){
		return id;
	}
	
	public String getInfo(){  //get general info
		return info;
	}
	
	public List<Long> getFriends(){
		return friendsID;
	}	
	
	public List<String> getFriendsIP(){
		return friendsIP;
	}
	
	public List<String> getFriendsName(){
		return friendsName;
	}
	
	public int getSendFileKey(){
		return sendFileKey;
	}
	
	public int getReceiveFileKey(){
		return receiveFileKey;
	}
	
	public String getFileName(){
		return fileName;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -