Class Do<T extends ACell>

Type Parameters:
T - Result type of Do Op
All Implemented Interfaces:
IValidated, IWriteable

public class Do<T extends ACell> extends AMultiOp<T>
Op for executing a sequence of child operations in order "Design is to take things apart in such a way that they can be put back together" - Rich Hickey
  • Field Details

    • EMPTY

      public static final Do<?> EMPTY
  • Constructor Details

  • Method Details

    • create

      public static <T extends ACell> Do<T> create(AOp<?>... ops)
    • recreate

      protected Do<T> recreate(ASequence<AOp<ACell>> newOps)
      Description copied from class: AMultiOp
      Recreates this object with an updated list of child Ops.
      Specified by:
      recreate in class AMultiOp<T extends ACell>
      Returns:
    • create

      public static <T extends ACell> Do<T> create(ASequence<AOp<ACell>> ops)
    • execute

      public <I extends ACell> Context<T> execute(Context<I> context)
      Description copied from class: AOp
      Executes this op with the given context. Must preserve depth unless an exceptional is returned.
      Specified by:
      execute in class AOp<T extends ACell>
      Type Parameters:
      I - Type of Context
      Parameters:
      context - Initial Context
      Returns:
      The updated Context after executing this operation
    • print

      public void print(StringBuilder sb)
      Description copied from class: AObject
      Prints this Object to a readable String Representation
      Specified by:
      print in class AObject
      Parameters:
      sb - StringBuilder to append to
    • opCode

      public byte opCode()
      Description copied from class: AOp
      Returns the opcode for this op
      Specified by:
      opCode in class AOp<T extends ACell>
      Returns:
      Opcode as a byte
    • read

      public static <T extends ACell> Do<T> read(ByteBuffer b) throws BadFormatException
      Throws:
      BadFormatException