1 |
ajm |
1.2 |
//---PACKAGE DECLARATION--- |
2 |
ajm |
1.1 |
|
3 |
ajm |
1.2 |
//---IMPORTS--- |
4 |
|
|
import java.util.ArrayList; |
5 |
|
|
|
6 |
|
|
/** |
7 |
|
|
* The Station class defines the operations that a compliant station should |
8 |
|
|
* implement |
9 |
|
|
* |
10 |
|
|
* @author $Author: tdb1 $ |
11 |
|
|
* @version $Id: TemplateClass.java,v 1.11 2001/03/22 21:50:41 tdb1 Exp $ |
12 |
|
|
*/ |
13 |
ajm |
1.1 |
abstract class Station { |
14 |
ajm |
1.2 |
|
15 |
|
|
//---FINAL / FINAL STATIC ATTRIBUTES--- |
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* The current CVS revision of this class |
19 |
|
|
*/ |
20 |
|
|
public static final String REVISION = "$Revision: 1.11 $"; |
21 |
|
|
|
22 |
|
|
//---STATIC METHODS--- |
23 |
|
|
|
24 |
|
|
//---CONSTRUCTORS--- |
25 |
|
|
|
26 |
|
|
//---PUBLIC METHODS--- |
27 |
|
|
|
28 |
ajm |
1.1 |
public abstract ArrayList getAllAgents(); |
29 |
ajm |
1.2 |
|
30 |
|
|
public abstract ArrayList getAllPeers(); |
31 |
|
|
|
32 |
ajm |
1.1 |
public abstract String getName(); |
33 |
ajm |
1.2 |
|
34 |
|
|
public abstract void sendAgent(Agent agent, PeerHandler Peer); |
35 |
|
|
|
36 |
|
|
/** |
37 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
38 |
|
|
* method to provide clean logging (every class should have this). |
39 |
|
|
* |
40 |
|
|
* This uses the uk.ac.ukc.iscream.util.FormatName class |
41 |
|
|
* to format the toString() |
42 |
|
|
* |
43 |
|
|
* @return the name of this class and its CVS revision |
44 |
|
|
*/ |
45 |
|
|
public String toString() { |
46 |
|
|
return FormatName.getName( |
47 |
|
|
_name, |
48 |
|
|
getClass().getName(), |
49 |
|
|
REVISION); |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
//---PRIVATE/PROTECTED METHODS--- |
53 |
|
|
|
54 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
55 |
|
|
|
56 |
|
|
//---ATTRIBUTES--- |
57 |
|
|
|
58 |
|
|
/** |
59 |
|
|
* This is the friendly identifier of the |
60 |
|
|
* component this class is running in. |
61 |
|
|
* eg, a Filter may be called "filter1", |
62 |
|
|
* If this class does not have an owning |
63 |
|
|
* component, a name from the configuration |
64 |
|
|
* can be placed here. This name could also |
65 |
|
|
* be changed to null for utility classes. |
66 |
|
|
*/ |
67 |
|
|
private String _name = null; |
68 |
|
|
|
69 |
|
|
/** |
70 |
|
|
* This holds a reference to the |
71 |
|
|
* system logger that is being used. |
72 |
|
|
*/ |
73 |
|
|
private Logger _logger = Logger.getInstance(); |
74 |
|
|
|
75 |
|
|
//---STATIC ATTRIBUTES--- |
76 |
|
|
|
77 |
ajm |
1.1 |
} |