1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.plugin.gift.net;
21
22 import java.util.StringTokenizer;
23
24 import javax.swing.Action;
25
26 import org.xnap.XNap;
27 import org.xnap.peer.AbstractPeer;
28
29
30 /***
31 * GiFTUser
32 *
33 * @author <a href="mailto:tvanlessen@taval.de">Tammo van Lessen</a>
34 * @version CVS $Id: GiFTUser.java,v 1.4 2004/07/20 18:02:28 leist Exp $
35 */
36 public class GiFTUser extends AbstractPeer {
37
38
39 private String username;
40 private String host;
41
42
43
44 /***
45 * Constructor for GiFTUser.
46 *
47 * @param user DOCUMENT ME!
48 */
49 public GiFTUser(String user) {
50 super(null);
51
52 username = user;
53
54 if (user != null) {
55 StringTokenizer st = new StringTokenizer(user, "@");
56
57 if (st.countTokens() == 1) {
58 setName(user);
59 this.host = user;
60 } else {
61 setName(st.nextToken());
62 this.host = st.nextToken();
63 }
64 }
65 }
66
67
68
69 /***
70 * @see xnap.peer.Peer#getActions()
71 */
72 public Action[] getActions() {
73 return null;
74 }
75
76 /***
77 * @see xnap.peer.Peer#getHost()
78 */
79 public String getHost() {
80 return host;
81 }
82
83 /***
84 * @see xnap.peer.Peer#getLocalDownloadCount()
85 */
86 public int getLocalDownloadCount() {
87 return 0;
88 }
89
90 /***
91 * @see xnap.peer.Peer#getLocalUploadCount()
92 */
93 public int getLocalUploadCount() {
94 return 0;
95 }
96
97 /***
98 * @see xnap.peer.Peer#getStatus()
99 */
100 public String getStatus() {
101 return XNap.tr("Online");
102 }
103
104 /***
105 * @return the username
106 */
107 public String getUsername() {
108 return username;
109 }
110
111 }