Class AbstractListCompositeComponent

    • Constructor Detail

      • AbstractListCompositeComponent

        public AbstractListCompositeComponent​(InfoModel infoModel)
        Info model constructor.
        Parameters:
        infoModel - The component info model.
        Throws:
        java.lang.NullPointerException - if the given info model is null.
    • Method Detail

      • getComponentList

        protected java.util.List<Component> getComponentList()
        Returns:
        The list of child components.
      • size

        protected int size()
        Returns:
        The number of child components in this component.
      • isEmpty

        protected boolean isEmpty()
        Returns:
        Whether this component contains no child components.
      • contains

        protected boolean contains​(java.lang.Object component)
        Determines whether this component contains the given component.
        Parameters:
        component - The component to check.
        Returns:
        true if this component contains the given component.
      • indexOf

        protected int indexOf​(java.lang.Object component)
        Returns the index in the component of the first occurrence of the specified component.
        Parameters:
        component - The component the index of which should be returned.
        Returns:
        The index in this component of the first occurrence of the specified component, or -1 if this component does not contain the given component.
      • lastIndexOf

        protected int lastIndexOf​(java.lang.Object component)
        Returns the index in this component of the last occurrence of the specified component.
        Parameters:
        component - The component the last index of which should be returned.
        Returns:
        The index in this component of the last occurrence of the specified component, or -1 if this component does not contain the given component.
      • get

        protected Component get​(int index)
        Returns the component at the specified index in the component.
        Parameters:
        index - The index of the component to return.
        Returns:
        The component at the specified position in this component.
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is out of range.
      • addComponent

        protected void addComponent​(int index,
                                    Component childComponent)
        Adds a child component at the specified index. This version adds the component to the component list. Any class that overrides this method must call this version.
        Parameters:
        index - The index at which the component should be added.
        childComponent - The component to add to this component.
        Throws:
        java.lang.IllegalArgumentException - if the component already has a parent or if the component is already a child of this composite component.
        java.lang.IndexOutOfBoundsException - if the index is less than zero or greater than the number of child components.
      • addComponent

        protected final void addComponent​(Component childComponent)
        Adds a child component. This version adds the component to the component set. Any class that overrides this method must call this version.

        This version adds the component to the component list.

        Overrides:
        addComponent in class AbstractMultipleCompositeComponent
        Parameters:
        childComponent - The component to add to this component.
      • removeComponent

        protected void removeComponent​(Component childComponent)
        Removes a child component. This version removes the component from the component set. Any class that overrides this method must call this version.

        This version removes the component from the component list.

        Overrides:
        removeComponent in class AbstractMultipleCompositeComponent
        Parameters:
        childComponent - The component to remove from this component.