| 1 |
< |
import java.util.*; |
| 1 |
> |
//---PACKAGE DECLARATION--- |
| 2 |
|
|
| 3 |
+ |
//---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$ |
| 11 |
+ |
* @version $Id$ |
| 12 |
+ |
*/ |
| 13 |
|
abstract class Station { |
| 14 |
+ |
|
| 15 |
+ |
//---FINAL / FINAL STATIC ATTRIBUTES--- |
| 16 |
+ |
|
| 17 |
+ |
/** |
| 18 |
+ |
* The current CVS revision of this class |
| 19 |
+ |
*/ |
| 20 |
+ |
public static final String REVISION = "$Revision$"; |
| 21 |
+ |
|
| 22 |
+ |
//---STATIC METHODS--- |
| 23 |
+ |
|
| 24 |
+ |
//---CONSTRUCTORS--- |
| 25 |
+ |
|
| 26 |
+ |
//---PUBLIC METHODS--- |
| 27 |
+ |
|
| 28 |
|
public abstract ArrayList getAllAgents(); |
| 29 |
+ |
|
| 30 |
+ |
public abstract ArrayList getAllPeers(); |
| 31 |
+ |
|
| 32 |
|
public abstract String getName(); |
| 33 |
+ |
|
| 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 |
|
} |