?? userinfo.java
字號:
import java.net.*;
/**
* Description:
* <br/>Copyright (C), 2008-2010, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author Yeeku.H.Lee kongyeeku@163.com
* @version 1.0
*/
public class UserInfo
{
//該用戶的圖標
private String icon;
//該用戶的名字
private String name;
//該用戶的MulitcastSocket所在的IP和端口
private SocketAddress address;
//該用戶失去聯系的次數
private int lost;
//該用戶對應的交談窗口
private ChatFrame chatFrame;
public UserInfo(){}
public UserInfo(String icon , String name , SocketAddress address , int lost)
{
this.icon = icon;
this.name = name;
this.address = address;
this.lost = lost;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return this.icon;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return this.name;
}
public void setAddress(SocketAddress address)
{
this.address = address;
}
public SocketAddress getAddress()
{
return this.address;
}
public void setLost(int lost)
{
this.lost = lost;
}
public int getLost()
{
return this.lost;
}
public void setChatFrame(ChatFrame chatFrame)
{
this.chatFrame = chatFrame;
}
public ChatFrame getChatFrame()
{
return this.chatFrame;
}
//使用address作為該用戶的標識
public int hashCode()
{
return address.hashCode();
}
public boolean equals(Object obj)
{
if (obj != null &&
obj.getClass() == UserInfo.class)
{
return ((UserInfo)obj).getAddress().equals(address);
}
return false;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -