1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.peer;
21
22 /***
23 * This class provides the default implementation for a peer.
24 */
25 public abstract class AbstractPeer implements Peer
26 {
27
28
29
30 private String clientInfo;
31 private int fileCount = -1;
32 private int linkSpeed = -1;
33 private String name;
34
35
36
37 public AbstractPeer(String name)
38 {
39 this.name = name;
40 }
41
42
43
44 public String getClientInfo()
45 {
46 return clientInfo;
47 }
48
49 public int getFileCount()
50 {
51 return fileCount;
52 }
53
54 public int getLinkSpeed()
55 {
56 return linkSpeed;
57 }
58
59 public String getName()
60 {
61 return name;
62 }
63
64 public void setClientInfo(String newValue)
65 {
66 clientInfo = newValue;
67 }
68
69 public void setFileCount(int newValue)
70 {
71 fileCount = newValue;
72 }
73
74 public void setLinkSpeed(int newValue)
75 {
76 linkSpeed = newValue;
77 }
78
79 public void setName(String name)
80 {
81 this.name = name;
82 }
83
84 /***
85 * Returns the value of {@link #getName() getName()}.
86 */
87 public String toString()
88 {
89 return getName();
90 }
91
92 }