|
|||||||||
| 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.Script
public class Script
Holds the script elements to be processed when running the simulation.
| Field Summary | |
|---|---|
private ScriptComponent |
current
Current script element. |
private boolean |
finished
Finished state. |
private Network |
network
The network this script is run on. |
private java.util.ArrayList<ScriptComponent> |
script
List of script elements. |
| Constructor Summary | |
|---|---|
Script(Network network)
Creates a new Script attached to the specified network. |
|
| Method Summary | |
|---|---|
void |
add(ScriptComponent sc)
Adds a script element. |
void |
add(ScriptComponent sc,
int id)
Adds a script element at the specified position. |
void |
clear()
Clears all the elements from the list. |
ScriptComponent |
get(int id)
Gets a script element. |
ScriptComponent |
getCurrent()
Gets the current element. |
java.util.Vector<ScriptComponent> |
getScript()
Gets the script. |
void |
moveDown(int id)
Move a script element down one position in the list. |
void |
moveUp(int id)
Move a script element up one position in the list. |
void |
remove(int id)
Removes a script element. |
void |
reset()
Resets the script to restart at the first element. |
boolean |
run(java.util.Vector<NetworkEvent> events,
boolean steppingMode)
Runs the script on the specified events. |
private boolean |
steppingMode(java.util.Vector<NetworkEvent> events)
Runs the simulation test in stepping mode (only valid if there is are no script elements). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Network network
private java.util.ArrayList<ScriptComponent> script
private ScriptComponent current
private boolean finished
| Constructor Detail |
|---|
public Script(Network network)
Script attached to the specified network.
network - The Network this script is run on.| Method Detail |
|---|
public java.util.Vector<ScriptComponent> getScript()
public ScriptComponent getCurrent()
public void add(ScriptComponent sc)
sc - The ScriptComponent to be added to the end of the list.
public void add(ScriptComponent sc,
int id)
sc - The ScriptComponent to be added.id - The position in the list to place the element.public ScriptComponent get(int id)
id - The position of the element.
id in the list.public void remove(int id)
id - The position of the element to be removed.public void moveUp(int id)
id - The position of the element to be moved up.public void moveDown(int id)
id - The position of the element to be moved down.public void clear()
public void reset()
public boolean run(java.util.Vector<NetworkEvent> events,
boolean steppingMode)
events - The events that have occurred on the NetworksteppingMode - Whether or not stepping mode is in use.
true if the simulation should be paused.private boolean steppingMode(java.util.Vector<NetworkEvent> events)
events - The events that have occurred on the Network
true if the simulation should be paused.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||