|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.arlott.simon.hw.f24.lbsta.ScriptComponent
uk.org.arlott.simon.hw.f24.lbsta.ScriptState
public class ScriptState
Represents a state to wait for in a script.
| Field Summary | |
|---|---|
static int |
BRIDGE_PORT_STATE_CHANGED
Bridge Port State Changed state. |
int |
bridgeID
Bridge ID. |
int |
bridgePort
Bridge Port. |
int |
dstHostAddress
Destination Host address. |
static int |
HOST_GETS_PACKET
Host Receives a Packet state. |
boolean |
pause
Whether or not the simulation should pause when this state is reached. |
int |
portState
Bridge Port state. |
static int |
ROOT_ID_AT_BRIDGE
Root ID at Bridge Changed state. |
int |
rootID
Root ID. |
static int |
SLEEP
Sleep state. |
static int |
SPANNING_TREE_ALGORITHM_COMPLETE
Spanning Tree Algorithm Complete state. |
int |
srcHostAddress
Source Host address. |
int |
time
Time to wait. |
int |
type
Type of this state. |
int |
waited
Time waited. |
| Constructor Summary | |
|---|---|
private |
ScriptState(int type,
boolean pause)
Creates a new ScriptState of the specified type. |
| Method Summary | |
|---|---|
boolean |
check(Network network,
java.util.Vector<NetworkEvent> events,
boolean first)
Check if this state has been reached on the network. |
static ScriptState |
createBridgePortStateChanged(int bridgeID,
int bridgePort,
int portState,
boolean pause)
Creates a new Bridge Port State Changed state. |
static ScriptState |
createHostGetsPacket(int srcHostAddress,
int dstHostAddress,
boolean pause)
Creates a new Host Received Packet state. |
static ScriptState |
createRootIDatBridge(int bridgeID,
int rootID,
boolean pause)
Creates a new Root ID Changed state. |
static ScriptState |
createSleep(int time,
boolean pause)
Creates a new Sleep state. |
static ScriptState |
createSpanningTreeAlgorithmComplete(int bridgeID,
boolean pause)
Creates a new Spanning Tree Algorithm Complete state. |
java.lang.String |
toString()
Gets a string representation of this state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SPANNING_TREE_ALGORITHM_COMPLETE
public static final int BRIDGE_PORT_STATE_CHANGED
public static final int HOST_GETS_PACKET
public static final int ROOT_ID_AT_BRIDGE
public static final int SLEEP
public int type
public boolean pause
public int bridgeID
public int bridgePort
public int portState
public int rootID
public int srcHostAddress
public int dstHostAddress
public int time
public int waited
| Constructor Detail |
|---|
private ScriptState(int type,
boolean pause)
ScriptState of the specified type.
type - The type of state to create.pause - Whether or not the simulation should pause when this state is reached.| Method Detail |
|---|
public static ScriptState createSpanningTreeAlgorithmComplete(int bridgeID,
boolean pause)
bridgeID - The Bridge ID to check the network from.pause - Whether or not the simulation should pause when this state is reached.
ScriptState.
public static ScriptState createBridgePortStateChanged(int bridgeID,
int bridgePort,
int portState,
boolean pause)
bridgeID - The Bridge ID.bridgePort - The Bridge Port ID.portState - The state the port should have changed to.pause - Whether or not the simulation should pause when this state is reached.
ScriptState.
public static ScriptState createHostGetsPacket(int srcHostAddress,
int dstHostAddress,
boolean pause)
srcHostAddress - The source Host address.dstHostAddress - The destination Host address.pause - Whether or not the simulation should pause when this state is reached.
ScriptState.
public static ScriptState createRootIDatBridge(int bridgeID,
int rootID,
boolean pause)
bridgeID - The Bridge ID.rootID - The root ID the bridge should have changed to.pause - Whether or not the simulation should pause when this state is reached.
ScriptState.
public static ScriptState createSleep(int time,
boolean pause)
time - The time to sleep for in seconds.pause - Whether or not the simulation should pause when this state is reached.
ScriptState.
public boolean check(Network network,
java.util.Vector<NetworkEvent> events,
boolean first)
network - The Network to check the state on.events - A list of events that have occured.first - true if this is the first time this state has been checked in this run of the Script.
true if the state has been reached.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||