Package org.jfree.report.structure
Class Section
- java.lang.Object
-
- org.jfree.report.structure.Node
-
- org.jfree.report.structure.Element
-
- org.jfree.report.structure.Section
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
DetailSection
,Group
,ReportDefinition
public class Section extends Element
A report section is a collection of other elements and sections. 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. The attribute and style expressions added to the element are considered unnamed and stateless. To define a named, statefull state expression, one would create an ordinary named expression or function and would then reference that expression from within a style or attribute expression.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jfree.report.structure.Element
ID_ATTRIBUTE, NAME_ATTRIBUTE, NAMESPACE_ATTRIBUTE, TYPE_ATTRIBUTE, VIRTUAL_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description Section()
Constructs a new band (initially empty).
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addNode(int position, Node element)
Adds a report element to the band.void
addNode(Node element)
Adds a report element to the band.void
addNodes(java.util.Collection elements)
Adds a collection of elements to the band.void
addOperationAfter(FlowControlOperation op)
void
addOperationBefore(FlowControlOperation op)
java.lang.Object
clone()
Element
findFirstChild(java.lang.String uri, java.lang.String tagName)
Element
getElementByName(java.lang.String name)
Returns the first element in the list that is known by the given name.Node
getNode(int index)
Returns the element stored add the given index.Node[]
getNodeArray()
Returns an array of the elements in the band.int
getNodeCount()
Returns the number of elements in this band.java.util.List
getNodes()
Deprecated.usegetElementArray()
instead.FlowControlOperation[]
getOperationAfter()
FlowControlOperation[]
getOperationBefore()
boolean
isRepeat()
void
removeNode(Node e)
Removes an element from the band.void
setOperationAfter(FlowControlOperation[] ops)
void
setOperationBefore(FlowControlOperation[] before)
void
setRepeat(boolean repeat)
java.lang.String
toString()
Returns a string representation of the band and all the elements it contains, useful mainly for debugging purposes.-
Methods inherited from class org.jfree.report.structure.Element
addExpression, getAttribute, getAttribute, getAttributeExpression, getAttributeExpression, getAttributeExpressionMap, getAttributeExpressions, getAttributeMap, getDisplayCondition, getExpressions, getId, getLocale, getLocaleFromAttributes, getName, getNamespace, getStyle, getStyleExpression, getStyleExpressions, getType, getVisibility, isEnabled, isVirtual, setAttribute, setAttribute, setAttributeExpression, setAttributeExpression, setDisplayCondition, setEnabled, setExpressions, setId, setName, setNamespace, setStyleExpression, setType, setVirtual, setVisibility
-
Methods inherited from class org.jfree.report.structure.Node
getGroup, getParent, getReport, getRootReport, setParent, updateParent
-
-
-
-
Method Detail
-
addNode
public void addNode(Node element)
Adds a report element to the band.- Parameters:
element
- the element that should be added- Throws:
java.lang.NullPointerException
- if the given element is nulljava.lang.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.
-
addNode
public void addNode(int position, Node 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 elementelement
- the element that should be added- Throws:
java.lang.NullPointerException
- if the given element is nulljava.lang.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.
-
addNodes
public void addNodes(java.util.Collection elements)
Adds a collection of elements to the band.- Parameters:
elements
- the element collection.- Throws:
java.lang.NullPointerException
- if one of the given elements is nulljava.lang.IllegalArgumentException
- if one of the given element is a parent of this element.
-
getElementByName
public Element getElementByName(java.lang.String name)
Returns the first element in the list that is known by the given name.- Parameters:
name
- the element name.- Returns:
- the first element with the specified name, or
null
if there is no such element. - Throws:
java.lang.NullPointerException
- if the given name is null.
-
removeNode
public void removeNode(Node e)
Removes an element from the band.- Parameters:
e
- the element to be removed.- Throws:
java.lang.NullPointerException
- if the given element is null.
-
getNodes
public java.util.List getNodes()
Deprecated.usegetElementArray()
instead.Returns all child-elements of this band as immutable list.- Returns:
- an immutable list of all registered elements for this band.
-
getNodeCount
public int getNodeCount()
Returns the number of elements in this band.- Returns:
- the number of elements of this band.
-
getNodeArray
public Node[] getNodeArray()
Returns an array of the elements in the band. If the band is empty, an empty array is returned. For performance reasons, a shared cached instance is returned. Do not modify the returned array or live with the consquences.- Returns:
- the elements.
-
getNode
public Node getNode(int index)
Returns the element stored add the given index.- Parameters:
index
- the element position within this band- Returns:
- the element
- Throws:
java.lang.IndexOutOfBoundsException
- if the index is invalid.
-
toString
public java.lang.String toString()
Returns a string representation of the band and all the elements it contains, useful mainly for debugging purposes.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this band.
-
getOperationBefore
public FlowControlOperation[] getOperationBefore()
-
getOperationAfter
public FlowControlOperation[] getOperationAfter()
-
setOperationBefore
public void setOperationBefore(FlowControlOperation[] before)
-
setOperationAfter
public void setOperationAfter(FlowControlOperation[] ops)
-
addOperationAfter
public void addOperationAfter(FlowControlOperation op)
-
addOperationBefore
public void addOperationBefore(FlowControlOperation op)
-
isRepeat
public boolean isRepeat()
-
setRepeat
public void setRepeat(boolean repeat)
-
findFirstChild
public Element findFirstChild(java.lang.String uri, java.lang.String tagName)
-
-