Class IdMapOperation

java.lang.Object
net.messagevortex.router.operation.AbstractOperation
net.messagevortex.router.operation.IdMapOperation
All Implemented Interfaces:
Serializable, Operation

public class IdMapOperation extends AbstractOperation implements Serializable
This is a dummy operation mainly for testing it maps output to input ids.
See Also:
  • Field Details

  • Constructor Details

    • IdMapOperation

      public IdMapOperation(int sourceId, int targetId, int number)

      Creates a simple operation mapping the input to the output ID.

      Parameters:
      sourceId - the first source ID to be mapped
      targetId - the first target ID to be mapped
      number - the number of subsequent blocks to be mapped
  • Method Details

    • getOutputId

      public int[] getOutputId()
      Description copied from interface: Operation

      Gets all ids which are written by this operation.

      Specified by:
      getOutputId in interface Operation
      Returns:
      array representing all ids which will be potentially set by this operation
    • getInputId

      public int[] getInputId()
      Description copied from interface: Operation

      Gets all ids which are required to execute this operation.

      Specified by:
      getInputId in interface Operation
      Returns:
      array representing all ids which will be potentially set by this operation
    • canRun

      public boolean canRun()
      Description copied from interface: Operation

      Checks if all prerequisiting fields do exist or can be provided by a subsequent operation.

      Specified by:
      canRun in interface Operation
      Specified by:
      canRun in class AbstractOperation
      Returns:
      true if all prerequisits can potentially be satisfied
    • execute

      public int[] execute(int[] id)
      Description copied from interface: Operation

      Executes the operation and sets at least the provided set of id.

      This operation might trigger to execute prerequisiting operations.

      Specified by:
      execute in interface Operation
      Specified by:
      execute in class AbstractOperation
      Parameters:
      id - the namespace id to be set minimally
      Returns:
      array representing all ids which have been set
    • toString

      public String toString()
      Overrides:
      toString in class Object