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 multipleExecutableCommandsinto 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 theExecutableCommandscontained in the array
-
Method Summary
Modifier and Type Method Description voidexec()A version ofexecBlocking()running in a separate Threadvoidexec(int time)A version ofexecBlocking(int)running in a separate ThreadvoidexecBlocking()Call theexecBlocking()methods of all contained commandsvoidexecBlocking(int time)Call theexecBlocking(int)methods of all contained commands with the provided time as the argumentstatic SequencefromCollection(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 theExecutableCommandscontained 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:
execin interfaceExecutableCommands- Overrides:
execin classCollection- See Also:
execBlocking()
-
exec
public void exec(int time)
A version ofexecBlocking(int)running in a separate Thread- Specified by:
execin interfaceExecutableCommands- Overrides:
execin classCollection- Parameters:
time- Argument forExecutableCommands.exec(int)- See Also:
execBlocking(int)
-
execBlocking
public void execBlocking()
Call theexecBlocking()methods of all contained commands- Specified by:
execBlockingin interfaceExecutableCommands- Overrides:
execBlockingin 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:
execBlockingin interfaceExecutableCommands- Overrides:
execBlockingin classCollection- Parameters:
time- Argument forExecutableCommands.execBlocking(int)- See Also:
ExecutableCommands.execBlocking(int)
-
-