Class Invoke<T extends ACell>

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

public class Invoke<T extends ACell> extends AMultiOp<T>
Op representing the invocation of a function. The first child Op identifies the function to be called, the remaining ops are arguments.
  • Constructor Details

  • Method Details

    • create

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

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

      public static <T extends ACell, A extends AOp<ACell>, F extends AOp<ACell>> Invoke<T> create(F f, ASequence<A> args)
    • recreate

      protected Invoke<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> Invoke<T> create(String string, AOp<?>... args)
    • execute

      public Context execute(Context 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>
      Parameters:
      context - Initial Context
      Returns:
      The updated Context after executing this operation
    • print

      public boolean print(BlobBuilder bb, long limit)
      Description copied from class: AObject
      Prints this Object to a readable String Representation. SECURITY: Must halt and return false in O(1) time when limit of printing is exceeded otherwise DoS attacks may be possible.
      Specified by:
      print in class AObject
      Parameters:
      bb - BlobBuilder to append to. May be partially written if print limit exceeded
      limit - Limit of printing in string bytes
      Returns:
      True if fully printed within limit, false otherwise
    • 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> Invoke<T> read(Blob b, int pos) throws BadFormatException
      Read an Invoke Op from a Blob encoding
      Parameters:
      b - Blob to read from
      pos - Start position in Blob (location of tag byte)
      Returns:
      New decoded instance
      Throws:
      BadFormatException - In the event of any encoding error