Interface ContainerModel

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addElement​(java.lang.String subject)
      Called to indicate that you should add (append) an element with the given subject to the container.
      void insertElement​(java.lang.String subject, int position)
      Called to indicate that you should insert an element with the given subject at the given position within the container.
      void removeElement​(java.lang.String subject)
      Called to indicate that you should remove the element with the given subject from the container.
      void removeElementsWithPrefix​(java.lang.String prefix)
      Called to indicate that you should remove all elements from the container that have a subject that matches the specified prefix.
    • Method Detail

      • addElement

        void addElement​(java.lang.String subject)

        Called to indicate that you should add (append) an element with the given subject to the container.

         

        The element must be added to the end of the container. For example, if there are three elements already in the container at positions 0, 1, and 2 respectively, adding a fourth element places it at position 3.

        Parameters:
        subject - The subject of the element to add.
      • removeElement

        void removeElement​(java.lang.String subject)

        Called to indicate that you should remove the element with the given subject from the container.

        Parameters:
        subject - The subject of the element to be to removed.
      • insertElement

        void insertElement​(java.lang.String subject,
                           int position)

        Called to indicate that you should insert an element with the given subject at the given position within the container.

        Parameters:
        subject - The subject of the element to be inserted.
        position - The position at which to insert the element. The first element in a container is at position 0.
      • removeElementsWithPrefix

        void removeElementsWithPrefix​(java.lang.String prefix)

        Called to indicate that you should remove all elements from the container that have a subject that matches the specified prefix.

         

        Instructions should be processed in the order in which they are retrieved from the ContainerMessage and this affects earlier instructions. For example, assume that in the same message you received these operations:

         

        1. Add a container element with subject /A/1,
        2. Remove all container elements with prefix /A,
        3. Add a container element with subject /A/2.

        When this sequence has been processed, the container should only contain the element /A/2, because /A/1 was removed at step 2.

        Parameters:
        prefix - The prefix to match subjects for which elements are to be removed from the container.