|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.function.LevelledExpressionList
A list of expressions/functions and associated levels. This class listens for report events, then passes these events on to the expressions and functions in *descending* level order.
Constructor Summary | |
LevelledExpressionList(ExpressionCollection ec,
ExpressionCollection fc)
Creates a new list. |
Method Summary | |
protected void |
addError(java.lang.Exception e)
Adds the error to the current list of errors. |
protected void |
clearError()
Clears the error list. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
connectDataRow(DataRow dr)
Connects the given datarow to the expression collection and all expressions contained in this collection. |
void |
disconnectDataRow(DataRow dr)
Disconnects the datarow from the expression. |
void |
firePrepareEvent(ReportEvent event)
Fires a prepare event. |
protected void |
firePrepareEventLayoutListener(ReportEvent event)
Fires a prepare event layout listeners. |
java.util.List |
getErrors()
Returns the list of errors, that occured during the last event handling. |
Expression |
getExpression(int index)
Returns an expression. |
int |
getLevel()
Gets the current level. |
java.util.Iterator |
getLevelsAscending()
Returns an iterator that provides access to the levels in ascending order. |
java.util.Iterator |
getLevelsDescending()
Returns an iterator that provides access to the levels in descending order. |
java.lang.Object |
getValue(int index)
Returns the values of an expression. |
void |
groupFinished(ReportEvent event)
Receives notification that a group is finished. |
void |
groupStarted(ReportEvent event)
Receives notification that a new group has started. |
boolean |
hasErrors()
Returns true, if this list has detected at least one error in the last operation. |
void |
itemsAdvanced(ReportEvent event)
Receives notification that a new row has been read. |
void |
itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed. |
void |
itemsStarted(ReportEvent event)
Receives notification that a group of item bands is about to be processed. |
void |
layoutComplete(LayoutEvent event)
Receives notification that the band layouting has completed. |
void |
pageCanceled(ReportEvent event)
Receives notification that a new page is being started. |
void |
pageFinished(ReportEvent event)
Receives notification that a page is completed. |
void |
pageStarted(ReportEvent event)
Receives notification that a new page is being started. |
void |
reportDone(ReportEvent event)
Receives notification that report generation has completed, the report footer was printed, no more output is done. |
void |
reportFinished(ReportEvent event)
Receives notification that report generation has finished (the last record is read and all groups are closed). |
void |
reportInitialized(ReportEvent event)
Receives notification that report generation has started. |
void |
reportStarted(ReportEvent event)
Receives notification that report generation has started. |
void |
setLevel(int level)
Sets the level. |
int |
size()
Size does not change, so it is cached. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LevelledExpressionList(ExpressionCollection ec, ExpressionCollection fc)
ec
- the expressions.fc
- the functions.Method Detail |
public void reportStarted(ReportEvent event)
The event carries a ReportState.Started state. Use this to prepare the report header.
reportStarted
in interface ReportListener
event
- the event.public void reportInitialized(ReportEvent event)
The event carries a ReportState.Started state. Use this to initialize the report.
reportInitialized
in interface ReportListener
event
- the event.public void reportFinished(ReportEvent event)
reportFinished
in interface ReportListener
event
- the event.public void pageStarted(ReportEvent event)
pageStarted
in interface ReportListener
event
- the event.public void pageCanceled(ReportEvent event)
pageCanceled
in interface PageEventListener
event
- the event.public void pageFinished(ReportEvent event)
pageFinished
in interface ReportListener
event
- the event.public void groupStarted(ReportEvent event)
The group can be determined by the report state's getCurrentGroup() function.
groupStarted
in interface ReportListener
event
- the event.public void groupFinished(ReportEvent event)
The group can be determined by the report state's getCurrentGroup() function.
groupFinished
in interface ReportListener
event
- the event.public void itemsStarted(ReportEvent event)
The next events will be itemsAdvanced events until the itemsFinished event is raised.
itemsStarted
in interface ReportListener
event
- the event.public void itemsFinished(ReportEvent event)
The itemBand is finished, the report starts to close open groups.
itemsFinished
in interface ReportListener
event
- the event.public void itemsAdvanced(ReportEvent event)
This event is raised before an ItemBand is printed.
itemsAdvanced
in interface ReportListener
event
- the event.public void layoutComplete(LayoutEvent event)
The event carries the current report state.
layoutComplete
in interface LayoutListener
event
- The event.public void reportDone(ReportEvent event)
reportDone
in interface ReportListener
event
- The event.public void connectDataRow(DataRow dr)
dr
- the datarow to be connected (null not permitted).
java.lang.IllegalStateException
- if there is a datarow already connected.
java.lang.NullPointerException
- if the given datarow is null.public void disconnectDataRow(DataRow dr)
dr
- the datarow to be connected.
java.lang.NullPointerException
- if the given datarow is null.public int size()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
will be true, and that the expression:x.clone() != x
will be true, but these are not absolute requirements. While it is typically the case that:x.clone().getClass() == x.getClass()
will be true, this is not an absolute requirement. Copying an object will typically entail creating a new instance of its class, but it also may require copying of internal data structures as well. No constructors are called.x.clone().equals(x)
The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.
The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time. The clone method is implemented by the class Object as a convenient, general utility for subclasses that implement the interface Cloneable, possibly also overriding the clone method, in which case the overriding definition can refer to this utility definition by the call:
super.clone()
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the object's class does not
support the Cloneable
interface. Subclasses
that override the clone
method can also
throw this exception to indicate that an instance cannot
be cloned.
java.lang.OutOfMemoryError
- if there is not enough memory.Cloneable
public void setLevel(int level)
level
- the level.public int getLevel()
public java.util.Iterator getLevelsDescending()
public java.util.Iterator getLevelsAscending()
public java.lang.Object getValue(int index)
index
- the function/expression index.
public Expression getExpression(int index)
index
- the function/expression index.
public java.util.List getErrors()
public boolean hasErrors()
protected void addError(java.lang.Exception e)
e
- the new exception that occured during the event dispatching.protected void clearError()
public void firePrepareEvent(ReportEvent event)
event
- the event.protected void firePrepareEventLayoutListener(ReportEvent event)
event
- the event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |