org.jfree.report.structure

Class Section

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

Constructor Summary
Section()
Constructs a new band (initially empty).
Method Summary
voidaddNode(Node element)
Adds a report element to the band.
voidaddNode(int position, Node element)
Adds a report element to the band.
voidaddNodes(Collection elements)
Adds a collection of elements to the band.
voidaddOperationAfter(FlowControlOperation op)
voidaddOperationBefore(FlowControlOperation op)
Objectclone()
ElementfindFirstChild(String uri, String tagName)
ElementgetElementByName(String name)
Returns the first element in the list that is known by the given name.
NodegetNode(int index)
Returns the element stored add the given index.
Node[]getNodeArray()
Returns an array of the elements in the band.
intgetNodeCount()
Returns the number of elements in this band.
ListgetNodes()
Returns all child-elements of this band as immutable list.
FlowControlOperation[]getOperationAfter()
FlowControlOperation[]getOperationBefore()
booleanisRepeat()
voidremoveNode(Node e)
Removes an element from the band.
voidsetOperationAfter(FlowControlOperation[] ops)
voidsetOperationBefore(FlowControlOperation[] before)
voidsetRepeat(boolean repeat)
StringtoString()
Returns a string representation of the band and all the elements it contains, useful mainly for debugging purposes.

Constructor Detail

Section

public Section()
Constructs a new band (initially empty).

Method Detail

addNode

public void addNode(Node 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.

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 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.

addNodes

public void addNodes(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.

addOperationAfter

public void addOperationAfter(FlowControlOperation op)

addOperationBefore

public void addOperationBefore(FlowControlOperation op)

clone

public Object clone()

findFirstChild

public Element findFirstChild(String uri, String tagName)

getElementByName

public Element getElementByName(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: NullPointerException if the given name is null.

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: IndexOutOfBoundsException if the index is invalid.

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.

getNodeCount

public int getNodeCount()
Returns the number of elements in this band.

Returns: the number of elements of this band.

getNodes

public List getNodes()

Deprecated: use getElementArray() instead.

Returns all child-elements of this band as immutable list.

Returns: an immutable list of all registered elements for this band.

getOperationAfter

public FlowControlOperation[] getOperationAfter()

getOperationBefore

public FlowControlOperation[] getOperationBefore()

isRepeat

public boolean isRepeat()

removeNode

public void removeNode(Node e)
Removes an element from the band.

Parameters: e the element to be removed.

Throws: NullPointerException if the given element is null.

setOperationAfter

public void setOperationAfter(FlowControlOperation[] ops)

setOperationBefore

public void setOperationBefore(FlowControlOperation[] before)

setRepeat

public void setRepeat(boolean repeat)

toString

public String toString()
Returns a string representation of the band and all the elements it contains, useful mainly for debugging purposes.

Returns: a string representation of this band.