Class AbstractContainer

    • Field Detail

      • m_Payload

        protected Comparable m_Payload
        the payload.
      • m_Updating

        protected boolean m_Updating
        whether an update is currently in progress and notifications are suppressed.
    • Constructor Detail

      • AbstractContainer

        protected AbstractContainer​(AbstractContainerManager manager,
                                    Comparable payload)
        Initializes the container.
        Parameters:
        manager - the manager this container belongs to
        payload - the payload of this container
    • Method Detail

      • initialize

        protected void initialize()
        Initializes members.
      • invalidate

        protected void invalidate()
        For invalidating cached data.

        Default implementation does nothing.
      • setManager

        public void setManager​(AbstractContainerManager value)
        Sets the container manager to use.
        Parameters:
        value - the manager
      • postProcessPayload

        protected void postProcessPayload()
        For post-processing the payload, just after it got set.

        Default implementation does nothing.
      • getPayload

        public Comparable getPayload()
        Returns the current payload.
        Returns:
        the payload
      • assign

        public void assign​(AbstractContainer c)
        Updates itself with the values from given container (the manager is excluded!). Derived classes need to override this method.
        Parameters:
        c - the container to get the values from
      • copy

        public AbstractContainer copy()
        Returns a shallow copy of itself.
        Returns:
        the copy
      • compareTo

        public int compareTo​(AbstractContainer o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareTo in interface Comparable<AbstractContainer>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two containers have the same ID.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare with
        Returns:
        true if the ID is the same
      • toString

        public String toString()
        Returns a string representation of the payload.
        Overrides:
        toString in class Object
        Returns:
        a string representation