|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.jfree.report.function.AbstractExpression
|
+--org.jfree.report.function.PercentageExpression
Computes the percentage for a column in relation to a base column.
The function undestands two parameters. Thedividend parameter is required
and denotes the name of an ItemBand-field which is used as dividend. The
divisor parameter is required and denotes the name of an ItemBand-field
which is uses as divisor.
If either the divident or the divisor are not numeric, the expression will return
null.
The formula used is as follows:
Percent := divident / divisorIf the flag
useDifference is set, the difference between base and subject
is used instead.
Percent := (divisor - divident) / divisor
| Constructor Summary | |
PercentageExpression()
Constructs a new function. |
|
| Method Summary | |
java.lang.String |
getDividend()
Returns the field used as dividend by the function. |
java.lang.String |
getDivisor()
Returns the field used as divisor by the function. |
java.lang.Object |
getValue()
Return the current function value. |
boolean |
isUseDifference()
|
void |
setDividend(java.lang.String dividend)
Sets the field name to be used as dividend for the function. |
void |
setDivisor(java.lang.String divisor)
Sets the field name to be used as divisor for the function. |
void |
setUseDifference(boolean useDifference)
|
| Methods inherited from class org.jfree.report.function.AbstractExpression |
clone,
getDataRow,
getDependencyLevel,
getInstance,
getName,
getReportConfiguration,
getResourceBundleFactory,
getRuntime,
isActive,
setActive,
setDependencyLevel,
setName,
setRuntime |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public PercentageExpression()
Initially the function has no name...be sure to assign one before using the function.
| Method Detail |
public boolean isUseDifference()
public void setUseDifference(boolean useDifference)
public java.lang.Object getValue()
The value is calculated as the quotient of two columns: the dividend column and the divisor column. If the divisor is zero, the return value is "n/a";
public java.lang.String getDividend()
The field name corresponds to a column name in the report's TableModel.
public java.lang.String getDivisor()
The field name corresponds to a column name in the report's TableModel.
public void setDividend(java.lang.String dividend)
The field name corresponds to a column name in the report's TableModel.
dividend - the field name (null not permitted).public void setDivisor(java.lang.String divisor)
The field name corresponds to a column name in the report's TableModel.
divisor - the field name (null not permitted).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||