Class OperationQueue
java.lang.Object
com.sk89q.worldedit.function.operation.OperationQueue
- All Implemented Interfaces:
Operation
Executes multiple queues in order.
-
Field Summary
Fields inherited from interface com.sk89q.worldedit.function.operation.Operation
warnedDeprecatedClasses -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new queue containing no operations.OperationQueue(Operation... operation) Create a new queue with operations from the given array.OperationQueue(Collection<Operation> operations) Create a new queue with operations from the given collection. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Abort the current task.Iterable<com.sk89q.worldedit.util.formatting.text.Component> Gets an iterable of messages that describe the current status of the operation.voidAdd a new operation to the queue.resume(RunContext run) Complete the next step.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sk89q.worldedit.function.operation.Operation
addStatusMessages
-
Constructor Details
-
OperationQueue
public OperationQueue()Create a new queue containing no operations. -
OperationQueue
Create a new queue with operations from the given collection.- Parameters:
operations- a collection of operations
-
OperationQueue
Create a new queue with operations from the given array.- Parameters:
operation- an array of operations
-
-
Method Details
-
offer
Add a new operation to the queue.- Parameters:
operation- the operation
-
resume
Description copied from interface:OperationComplete the next step. If this method returns true, then the method may be called again in the future, or possibly never. If this method returns false, then this method should not be called again.- Specified by:
resumein interfaceOperation- Parameters:
run- describes information about the current run- Returns:
- another operation to run that operation again, or null to stop
- Throws:
WorldEditException- an error
-
cancel
public void cancel()Description copied from interface:OperationAbort the current task. After the this method is called,Operation.resume(RunContext)should not be called at any point in the future. This method should not be called after successful completion of the operation. This method must be called if the operation is interrupted before completion. -
getStatusMessages
Description copied from interface:OperationGets an iterable of messages that describe the current status of the operation.- Specified by:
getStatusMessagesin interfaceOperation- Returns:
- The status messages
-