added gitignore
[clientserver.git] / User.java
blob00a93b31d80f772125aae57ba47897674312c725
1 /*
2 * @(#)User.java
3 * Time-stamp: "2007-09-20 14:22:10 anton"
4 */
6 import java.net.InetAddress;
8 /**
9 * User
11 * @author "Anton Johansson" <anton.johansson@gmail.com>
14 public class User {
15 private InetAddress IPAdress;
16 private int port;
17 private String nickName;
18 private Channel currentChannel;
20 public User(String nickName, InetAddress IPAdress, int port) {
21 this.nickName = nickName;
22 this.IPAdress = IPAdress;
23 this.port = port;
26 public void changeNick(String newNick) {
27 this.nickName = newNick;
30 public void joinChannel(Channel channel) {
31 this.currentChannel = channel;
34 public void leaveChannel() {
35 this.currentChannel = null;
38 public void setPort(int port) {
39 this.port = port;
42 // Get-methods
43 public String getNick() {
44 return this.nickName;
47 public InetAddress getIPAddress() {
48 return this.IPAdress;
51 public int getPort() {
52 return this.port;
55 public Channel getChannel() {
56 return this.currentChannel;