Class OperationQueue

java.lang.Object
com.sk89q.worldedit.function.operation.OperationQueue
All Implemented Interfaces:
Operation

public class OperationQueue extends Object implements Operation
Executes multiple queues in order.
  • Constructor Details

    • OperationQueue

      public OperationQueue()
      Create a new queue containing no operations.
    • OperationQueue

      public OperationQueue(Collection<Operation> operations)
      Create a new queue with operations from the given collection.
      Parameters:
      operations - a collection of operations
    • OperationQueue

      public OperationQueue(Operation... operation)
      Create a new queue with operations from the given array.
      Parameters:
      operation - an array of operations
  • Method Details

    • offer

      public void offer(Operation operation)
      Add a new operation to the queue.
      Parameters:
      operation - the operation
    • resume

      public Operation resume(RunContext run) throws WorldEditException
      Description copied from interface: Operation
      Complete 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:
      resume in interface Operation
      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: Operation
      Abort 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.
      Specified by:
      cancel in interface Operation
    • getStatusMessages

      public Iterable<com.sk89q.worldedit.util.formatting.text.Component> getStatusMessages()
      Description copied from interface: Operation
      Gets an iterable of messages that describe the current status of the operation.
      Specified by:
      getStatusMessages in interface Operation
      Returns:
      The status messages