|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.Element
org.pentaho.reporting.engine.classic.core.Section
org.pentaho.reporting.engine.classic.core.Band
public class Band
A report band is a collection of other elements and bands, similiar to an AWT-Container.
This implementation is not synchronized, to take care that you externally synchronize it when using multiple threads to modify instances of this class. Trying to add a parent of an band as child to the band, will result in an exception.
Field Summary | |
---|---|
static String |
ANONYMOUS_BAND_PREFIX
The prefix for anonymous bands, bands without an userdefined name. |
static String |
CONTENT_TYPE
Deprecated. The content-type is no longer used. |
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element |
---|
ANONYMOUS_ELEMENT_PREFIX |
Constructor Summary | |
---|---|
Band()
Constructs a new band (initially empty). |
|
Band(boolean pagebreakBefore,
boolean pagebreakAfter)
Constructs a new band with the given pagebreak attributes. |
|
Band(InstanceID id)
|
Method Summary | |
---|---|
void |
addElement(Element element)
Adds a report element to the band. |
void |
addElement(int position,
Element element)
Adds a report element to the band. |
void |
addElements(Collection elements)
Adds a collection of elements to the band. |
void |
clear()
|
Object |
clone()
Clones this band and all elements contained in this band. |
Element |
derive(boolean preserveElementInstanceIds)
Creates a deep copy of this element and regenerates all instance-ids. |
ReportElement |
getElement(int index)
Returns the element stored add the given index. |
Element |
getElement(String name)
Returns the first element in the list that is known by the given name. |
Element[] |
getElementArray()
Returns an array of the elements in the band. |
int |
getElementCount()
Returns the number of elements in this band. |
boolean |
isPagebreakAfterPrint()
Returns, whether the page layout manager should perform a pagebreak before this page is printed. |
boolean |
isPagebreakBeforePrint()
Returns, whether the page layout manager should perform a pagebreak before this page is printed. |
void |
removeElement(Element e)
Removes an element from the band. |
void |
setElementAt(int position,
Element element)
|
void |
setPagebreakAfterPrint(boolean pagebreakAfterPrint)
Defines, whether the page layout manager should perform a pagebreak before this page is printed. |
void |
setPagebreakBeforePrint(boolean pagebreakBeforePrint)
Defines, whether the page layout manager should perform a pagebreak before this page is printed. |
String |
toString()
Returns a string representation of the band, useful mainly for debugging purposes. |
Element[] |
unsafeGetElementArray()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONTENT_TYPE
public static final String ANONYMOUS_BAND_PREFIX
Constructor Detail |
---|
public Band()
public Band(InstanceID id)
public Band(boolean pagebreakBefore, boolean pagebreakAfter)
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 |
---|
public void addElement(Element element)
element
- the element that should be added
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.public void addElement(int position, Element element)
position
- the position where to insert the elementelement
- the element that should be added
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.public void addElements(Collection elements)
elements
- the element collection.
NullPointerException
- if one of the given elements is null
IllegalArgumentException
- if one of the given element is a parent of this element.public Element getElement(String name)
FunctionUtilities.findAllElements(Band, String)
or FunctionUtilities.findElement(Band, String)
instead.
name
- the element name.
null
if there is no such element.
NullPointerException
- if the given name is null.public void removeElement(Element e)
e
- the element to be removed.
NullPointerException
- if the given element is null.public void setElementAt(int position, Element element)
setElementAt
in class Section
public void clear()
public int getElementCount()
getElementCount
in class Section
public Element[] getElementArray()
unsafeGetElementArray()
method now.
public final Element[] unsafeGetElementArray()
public ReportElement getElement(int index)
getElement
in class Section
index
- the element position within this band
IndexOutOfBoundsException
- if the index is invalid.public String toString()
toString
in class Element
public Object clone() throws CloneNotSupportedException
clone
in interface DataTarget
clone
in class Element
CloneNotSupportedException
- if this band or an element contained in this band does not support cloning.public Element derive(boolean preserveElementInstanceIds) throws CloneNotSupportedException
derive
in class Element
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.
CloneNotSupportedException
- if there was an error while cloning this or any child object.public boolean isPagebreakBeforePrint()
public void setPagebreakBeforePrint(boolean pagebreakBeforePrint)
pagebreakBeforePrint
- set to true, if to force a pagebreak before this band is printed, false otherwisepublic boolean isPagebreakAfterPrint()
public void setPagebreakAfterPrint(boolean pagebreakAfterPrint)
pagebreakAfterPrint
- set to true, if to force a pagebreak before this band is printed, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |