Class Band

    • Field Detail

      • ANONYMOUS_BAND_PREFIX

        public static final String ANONYMOUS_BAND_PREFIX
        The prefix for anonymous bands, bands without an userdefined name.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Band

        public Band()
        Constructs a new band (initially empty).
      • Band

        public Band​(boolean pagebreakBefore,
                    boolean pagebreakAfter)
        Constructs a new band with the given pagebreak attributes. Pagebreak attributes have no effect on subbands.
        Parameters:
        pagebreakAfter - defines, whether a pagebreak should be done after that band was printed.
        pagebreakBefore - defines, whether a pagebreak should be done before that band gets printed.
    • Method Detail

      • addElement

        public void addElement​(Element element)
        Adds a report element to the band.
        Parameters:
        element - the element that should be added
        Throws:
        NullPointerException - if the given element is null
        IllegalArgumentException - if the position is invalid, either negative or greater than the number of elements in this band or if the given element is a parent of this element.
      • addElement

        public void addElement​(int position,
                               Element element)
        Adds a report element to the band. The element will be inserted at the specified position.
        Parameters:
        position - the position where to insert the element
        element - the element that should be added
        Throws:
        NullPointerException - if the given element is null
        IllegalArgumentException - if the position is invalid, either negative or greater than the number of elements in this band or if the given element is a parent of this element.
      • addElements

        public void addElements​(Collection elements)
        Adds a collection of elements to the band.
        Parameters:
        elements - the element collection.
        Throws:
        NullPointerException - if one of the given elements is null
        IllegalArgumentException - if one of the given element is a parent of this element.
      • removeElement

        public void removeElement​(Element e)
        Removes an element from the band.
        Specified by:
        removeElement in class Section
        Parameters:
        e - the element to be removed.
        Throws:
        NullPointerException - if the given element is null.
      • removeElement

        public void removeElement​(int index)
      • clear

        public void clear()
      • getElementCount

        public int getElementCount()
        Returns the number of elements in this band.
        Specified by:
        getElementCount in class Section
        Returns:
        the number of elements of this band.
      • getElementArray

        public Element[] getElementArray()
        Returns an array of the elements in the band. If the band is empty, an empty array is returned.

        Implementation note: The array returned is a copy of the internal backend. Any modification of the array will no longer result in modifications of the internal object state. To avoid unneccessary object creations, you can use the unsafeGetElementArray() method now.

        Returns:
        the elements.
      • unsafeGetElementArray

        public final Element[] unsafeGetElementArray()
      • getElement

        public Element getElement​(int index)
        Returns the element stored add the given index.
        Specified by:
        getElement in class Section
        Parameters:
        index - the element position within this band
        Returns:
        the element
        Throws:
        IndexOutOfBoundsException - if the index is invalid.
      • toString

        public String toString()
        Returns a string representation of the band, useful mainly for debugging purposes.
        Overrides:
        toString in class Element
        Returns:
        a string representation of this band.
      • clone

        public Band clone()
        Clones this band and all elements contained in this band. After the cloning the band is no longer connected to a report definition.
        Specified by:
        clone in interface DataTarget
        Overrides:
        clone in class Section
        Returns:
        the clone of this band.
      • derive

        public Band derive​(boolean preserveElementInstanceIds)
        Creates a deep copy of this element and regenerates all instance-ids.
        Overrides:
        derive in class Section
        Parameters:
        preserveElementInstanceIds - defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.
        Returns:
        the copy of the element.
      • isPagebreakBeforePrint

        public boolean isPagebreakBeforePrint()
        Returns, whether the page layout manager should perform a pagebreak before this page is printed. This will have no effect on empty pages or if the band is no root-level band.
        Returns:
        true, if to force a pagebreak before this band is printed, false otherwise
      • setPagebreakBeforePrint

        public void setPagebreakBeforePrint​(boolean pagebreakBeforePrint)
        Defines, whether the page layout manager should perform a pagebreak before this page is printed. This will have no effect on empty pages or if the band is no root-level band.
        Parameters:
        pagebreakBeforePrint - set to true, if to force a pagebreak before this band is printed, false otherwise
      • isPagebreakAfterPrint

        public boolean isPagebreakAfterPrint()
        Returns, whether the page layout manager should perform a pagebreak before this page is printed. This will have no effect on empty pages or if the band is no root-level band.
        Returns:
        true, if to force a pagebreak before this band is printed, false otherwise
      • setPagebreakAfterPrint

        public void setPagebreakAfterPrint​(boolean pagebreakAfterPrint)
        Defines, whether the page layout manager should perform a pagebreak before this page is printed. This will have no effect on empty pages or if the band is no root-level band.
        Parameters:
        pagebreakAfterPrint - set to true, if to force a pagebreak before this band is printed, false otherwise
      • setLayout

        public void setLayout​(String layout)
      • getLayout

        public String getLayout()