Package api.advanced
Class Sequence
- java.lang.Object
-
- api.advanced.Collection
-
- api.advanced.Sequence
-
- All Implemented Interfaces:
ExecutableCommands
public class Sequence extends Collection
A tool to combine multipleExecutableCommands
into one object, which runs one command after another.- See Also:
test.Example5
,ExecutableCommands
,Bundle
,Collection
-
-
Constructor Summary
Constructors Constructor Description Sequence()
Create a new, empty SequenceSequence(ExecutableCommands[] commands)
Create a sequence and initialize it with theExecutableCommands
contained in the array
-
Method Summary
Modifier and Type Method Description void
exec()
A version ofexecBlocking()
running in a separate Threadvoid
exec(int time)
A version ofexecBlocking(int)
running in a separate Threadvoid
execBlocking()
Call theexecBlocking()
methods of all contained commandsvoid
execBlocking(int time)
Call theexecBlocking(int)
methods of all contained commands with the provided time as the argumentstatic Sequence
fromCollection(Collection c)
Creates a new sequence by taking the ExecutableCommands from a Collection and initializing a new Sequence using them-
Methods inherited from class api.advanced.Collection
add, equals, getCommand, getCommands, getTime, getTree, printTree, remove
-
-
-
-
Constructor Detail
-
Sequence
public Sequence()
Create a new, empty Sequence
-
Sequence
public Sequence(ExecutableCommands[] commands)
Create a sequence and initialize it with theExecutableCommands
contained in the array- Parameters:
commands
- An array of ExecutableCommands
-
-
Method Detail
-
fromCollection
public static Sequence fromCollection(Collection c)
Creates a new sequence by taking the ExecutableCommands from a Collection and initializing a new Sequence using them- Parameters:
c
- The Collection to be converted- Returns:
- The newly generated Collection
-
exec
public void exec()
A version ofexecBlocking()
running in a separate Thread- Specified by:
exec
in interfaceExecutableCommands
- Overrides:
exec
in classCollection
- See Also:
execBlocking()
-
exec
public void exec(int time)
A version ofexecBlocking(int)
running in a separate Thread- Specified by:
exec
in interfaceExecutableCommands
- Overrides:
exec
in classCollection
- Parameters:
time
- Argument forExecutableCommands.exec(int)
- See Also:
execBlocking(int)
-
execBlocking
public void execBlocking()
Call theexecBlocking()
methods of all contained commands- Specified by:
execBlocking
in interfaceExecutableCommands
- Overrides:
execBlocking
in classCollection
- See Also:
ExecutableCommands.execBlocking()
-
execBlocking
public void execBlocking(int time)
Call theexecBlocking(int)
methods of all contained commands with the provided time as the argument- Specified by:
execBlocking
in interfaceExecutableCommands
- Overrides:
execBlocking
in classCollection
- Parameters:
time
- Argument forExecutableCommands.execBlocking(int)
- See Also:
ExecutableCommands.execBlocking(int)
-
-