Class TransformerContainerImpl

java.lang.Object
com.caplin.transformer.module.datasrc.TransformerDataImpl
com.caplin.transformer.module.datasrc.TransformerContainerImpl
All Implemented Interfaces:
DSContainer, DSData, DSPacket, DSSerializable, TransformerContainer, TransformerData, TransformerFlags, Iterable<DSField>

public class TransformerContainerImpl extends TransformerDataImpl implements TransformerContainer
Implementation of the TransformerContainer interface.
  • Constructor Details

    • TransformerContainerImpl

      protected TransformerContainerImpl(long dsDataPointer)

      Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class.

      A TransformerContainer created with this constructor will be responsible for freeing the memory for the underlying C ds_data struct.

      This is equivalent to calling TransformerContainer(dsDataPointer, true).

      Parameters:
      dsDataPointer - The pointer to the C ds_data struct that holds the state information for the update.
    • TransformerContainerImpl

      protected TransformerContainerImpl(long dsDataPointer, boolean freeDsDataPointer)

      Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class.

      Parameters:
      dsDataPointer - The pointer to the C ds_data struct that holds the state information for the update.
      freeDsDataPointer - true if the TransformerContainer is responsible for freeing up the memory for the C ds_data struct, or false if the Transformer core is responsible.
  • Method Details

    • addObject

      public void addObject(String objectName)
      Description copied from interface: DSContainer

      Adds an instruction to append an object to this container.

      Specified by:
      addObject in interface DSContainer
      Parameters:
      objectName - the name of the object to be appended to this container (e.g. /OBJ1).
    • addObject

      public void addObject(String objectName, boolean makeRequest)
      Description copied from interface: DSContainer

      Adds an instruction to append an object to this container.

      Specified by:
      addObject in interface DSContainer
      Parameters:
      objectName - the name of the object to be appended to this container (e.g. /OBJ1).
      makeRequest - true if the receiving DataSource should make a request for this object, false if this DataSource will automatically send the object without it needing to be requested.
    • removeObject

      public void removeObject(String objectName)
      Description copied from interface: DSContainer

      Adds an instruction to remove an object from this container.

      Specified by:
      removeObject in interface DSContainer
      Parameters:
      objectName - the name of the object to be removed from this container (e.g. /OBJ1).
    • insertObject

      public void insertObject(String objectName, int position)
      Description copied from interface: DSContainer

      Adds an instruction to insert an object into this container, pushing any object currently at that position, and all objects at successive positions, up one place (to the next higher index position).

      If insertObject is called more than once on the same DSContainer, the subsequent inserts are relative to the earlier ones. For example, assume a container has object X at position 9 and object Y at position 10. Now insert object A at position 5, followed by object B at position 10. The insertion of object A moves X to position 10 and Y to position 11. When B is subsequently inserted at position 10, it goes immediately before X, not before Y; X moves to position 11 and Y moves to position 12.

      Specified by:
      insertObject in interface DSContainer
      Parameters:
      objectName - the name of the object to be inserted into this container (e.g. /OBJ1).
      position - the position in the container where the object is to be inserted, where position 0 (zero) represents the position of the first object.
    • cleardownObjectsWithPrefix

      public void cleardownObjectsWithPrefix(String prefix)
      Description copied from interface: DSContainer

      Adds an instruction to remove all objects from the container that have an object name that matches the provided prefix.

      Instructions are processed in the order that they are added to the container and affect earlier instructions. For example, if in the same message you add object /A/1, clear down based on the prefix /A and add object /A/2 then the processed container will only contain object /A/2 because object /A/1 will be cleared.

      Specified by:
      cleardownObjectsWithPrefix in interface DSContainer
      Parameters:
      prefix - The prefix to match object names against and remove from the container.