|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Speck
The interface for a speck. You'll probably want to subclass
AbstractSpeck for your implementation, as it
takes care of the unique ID stuff, along with methods to get a
seeded random number generator and to control logging.
| Field Summary | |
|---|---|
static int |
ID_BITS
The number of bits used in the id |
static java.lang.String |
SPECK_LOG_SOURCE
The source to use for logging speck events |
| Method Summary | |
|---|---|
void |
deInit()
Called when the speck is removed from the simulator. |
java.lang.String |
getFlavourName()
Gets a name for this flavour of Speck |
SpeckState |
getState()
Takes a snapshot of the state of this speck. |
int |
id()
Gets a unique identifier for this speck |
void |
initialise(SpeckCapability simulator)
Called when the speck is added to the simulator, and when the simulator is reset. |
void |
setID(int ID)
Sets this speck's ID. |
void |
shellEncountered(Speck sender,
MessageShell shell,
Message message)
Called when the simulator determines that this speck lies within the bounds of a transmission. |
| Methods inherited from interface com.ryanm.config.Configurable |
|---|
getConfigurator |
| Field Detail |
|---|
static final int ID_BITS
static final java.lang.String SPECK_LOG_SOURCE
| Method Detail |
|---|
java.lang.String getFlavourName()
int id()
void setID(int ID)
ID - The ID to setvoid initialise(SpeckCapability simulator)
simulator - The simulator that the speck is added tovoid deInit()
SimulationEvents that have this
speck as a parent will automatically be removed for you.
void shellEncountered(Speck sender,
MessageShell shell,
Message message)
sender - The speck that sent the messageshell - The shell used to send the messagemessage - The content of the messageSpeckState getState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||