|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.Field
com.inet.report.SummaryField
public class SummaryField
A summary field summarizes data of other fields in the report. You can print out the
summary with a FieldElement or a FieldPart. To create a new SummaryField use the method
Fields.addSummaryField(Field, int, String) in class Fields and give the field which data should summarized
and the kind of the summary using the constants.
This class is part of the RDC.
Fields.addSummaryField(Field, Field, int, String),
Fields.addSummaryField(Field, int, String),
Fields.getSummaryFieldsCount(),
Fields.getSummaryField(int),
Fields.removeSummaryField(int),
FieldElement,
FieldPart,
Serialized Form| Field Summary | |
|---|---|
static int |
AVERAGE
SummaryField calculates average. |
static int |
CORRELATION
SummaryField calculates correlation. |
static int |
COUNT
SummaryField calculates count. |
static int |
COVARIANCE
SummaryField calculates covariance. |
static int |
DISTINCT_COUNT
SummaryField calculates distinct count. |
static int |
MAXIMUM
SummaryField calculates maximum. |
static int |
MEDIAN
SummaryField calculates median. |
static int |
MINIMUM
SummaryField calculates minimum. |
static int |
MODE
SummaryField calculates mode. |
static int |
NO_SUMMARY_OPERATION
SummaryField calculates no operation, data will returned originally. |
static int |
NTH_LARGEST
SummaryField calculates Nth lagest. |
static int |
NTH_MOST_FREQUENT
SummaryField calculates Nth most frequent. |
static int |
NTH_SMALLEST
SummaryField calculates Nth smallest. |
static int |
PERCENTAGE
SummaryField calculates percentage. |
static int |
PERCENTILE
SummaryField calculates percentile. |
static int |
POP_STANDARD_DEVIATION
SummaryField calculates population standard deviation. |
static int |
POP_VARIANCE
SummaryField calculates population variance. |
static int |
SAMPLE_STANDARD_DEVIATION
SummaryField calculates sample standard deviation. |
static int |
SAMPLE_VARIANCE
SummaryField calculates sample varianz. |
static int |
SUM
SummaryField calculates sum. |
static int |
SUMMARY_CHART
Indicates that this summary field belongs to the chart object |
static int |
SUMMARY_CROSSTAB
Indicates that this summary field belongs to the crosstab column object |
static int |
SUMMARY_REPORT
Indicates that this summary field belongs to the report object |
static int |
WEIGHTED_AVERAGE
SummaryField calculates weigted average. |
protected com.inet.report.DefaultReferenceHolder |
defaultHolder
contains referenced objects |
| Fields inherited from class com.inet.report.Field |
|---|
BINARY, BOOLEAN, CURRENCY, CURSOR, DATABASE_FIELD, DATE, DATETIME, FORMULA_FIELD, GROUP_NAME_FIELD, NUMBER, PARAMETER_FIELD, SORT_FIELD, SPECIAL_FIELD, SQL_FIELD, STRING, SUMMARY_FIELD, TIME, UNKNOWN |
| Method Summary | |
|---|---|
Field |
duplicate(java.lang.String name)
Duplicates this field with all its settings and returns the created Field with the given name. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other SummaryField is "equal to" this one. |
static java.lang.String |
generateName(java.lang.String field,
java.lang.String group,
int sumType)
Generates the name of a summary field, i.e. |
static java.lang.String |
generateName(java.lang.String field,
java.lang.String group,
int sumType,
java.lang.String field2)
Generates the name of a summary field, i.e. |
Field |
getChangeField()
Running total changes if this field value was changed. |
Field |
getField2nd()
Some Summaries need two fields for calculation, i.e. weighted average, correlation etc. |
static java.lang.String |
getOperationName(int operation)
Returns the name of the operation by id. |
Field |
getResetField()
Running total is reset if this field value was changed. |
boolean |
getRunningTotal()
Returns the running total property of this SummaryField. |
boolean |
getShowPercentVal()
How result of summary operation is shown. |
int |
getSummaryFieldType()
Indicates to which object this summary field belongs. |
int |
getSummaryNth()
Returns the Nth value in Nth-functions. |
int |
getSummaryOperation()
Returns the value of the property 'summary operation'. |
static int |
getSummaryOperation(java.lang.String operation)
Returns the operation constant according to the name |
int |
getValueType()
Returns the value type (or return type) of the field. |
java.lang.String |
paramString()
Returns a prettified output of this field's name and type. |
NodeParser |
parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XML Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. |
protected void |
saveFieldXML2(java.io.PrintWriter pw,
int depth)
Saves SummaryField attributes |
void |
setChangeField(Field changeField)
Running total changes if this field value was changed. |
void |
setField(Field newField)
Sets the field witch values will be used by result calculating of this summary field. |
void |
setField2nd(Field field2nd)
Sets the second field. |
void |
setGroup(Group group)
Sets the group this field should associated with. |
void |
setName(java.lang.String name)
Sets the name of the summary field. |
void |
setResetField(Field rstField)
Running total Field reset if this field value was changed. |
void |
setRunningTotal(boolean isRunningTotal)
Sets the running total property of this SummaryField. |
void |
setShowPercentVal(boolean newValue)
Sets how the result of summary operation is shown. |
void |
setSummaryFieldType(int type)
Sets to which object this summary field belongs. |
void |
setSummaryNth(int summaryNth)
Sets the Nth value in Nth-functions. |
void |
setSummaryOperation(int operation)
Sets the value of the property 'summary operation'. |
Validity |
validate()
Check if the object is valid and returns the state and details of possible errors. |
| Methods inherited from class com.inet.report.Field |
|---|
checkNameExists, extractReference, getField, getGroup, getName, getPlaceholderName, getRefName, getType, indexOf, setValueType, trimAwayBrackets |
| Methods inherited from interface com.inet.report.parser.NodeParser |
|---|
isDOMParser, parseDOM, parseEndElement, parseText |
| Field Detail |
|---|
public static final int SUM
public static final int AVERAGE
public static final int SAMPLE_VARIANCE
public static final int SAMPLE_STANDARD_DEVIATION
public static final int MAXIMUM
public static final int MINIMUM
public static final int COUNT
public static final int POP_VARIANCE
public static final int POP_STANDARD_DEVIATION
public static final int DISTINCT_COUNT
public static final int CORRELATION
public static final int COVARIANCE
public static final int WEIGHTED_AVERAGE
public static final int MEDIAN
public static final int PERCENTILE
public static final int NTH_LARGEST
public static final int NTH_SMALLEST
public static final int MODE
public static final int NTH_MOST_FREQUENT
public static final int PERCENTAGE
public static final int NO_SUMMARY_OPERATION
public static final int SUMMARY_REPORT
public static final int SUMMARY_CROSSTAB
public static final int SUMMARY_CHART
protected com.inet.report.DefaultReferenceHolder defaultHolder
| Method Detail |
|---|
public void setName(java.lang.String name)
setName in class Fieldname - the name for this summary field.
java.lang.IllegalArgumentException - will thrown if the name already exists or if the name is null or empty.public final void setSummaryOperation(int operation)
operation - The new value of the property 'summary operation'.SUM,
AVERAGE,
SAMPLE_VARIANCE,
SAMPLE_STANDARD_DEVIATION,
MAXIMUM,
MINIMUM,
COUNT,
POP_VARIANCE,
POP_STANDARD_DEVIATION,
DISTINCT_COUNT,
CORRELATION,
COVARIANCE,
WEIGHTED_AVERAGE,
MEDIAN,
PERCENTILE,
NTH_LARGEST,
NTH_SMALLEST,
MODE,
NTH_MOST_FREQUENT,
PERCENTAGE,
NO_SUMMARY_OPERATIONpublic int getSummaryOperation()
SUM,
AVERAGE,
SAMPLE_VARIANCE,
SAMPLE_STANDARD_DEVIATION,
MAXIMUM,
MINIMUM,
COUNT,
POP_VARIANCE,
POP_STANDARD_DEVIATION,
DISTINCT_COUNT,
CORRELATION,
COVARIANCE,
WEIGHTED_AVERAGE,
MEDIAN,
PERCENTILE,
NTH_LARGEST,
NTH_SMALLEST,
MODE,
NTH_MOST_FREQUENT,
PERCENTAGE,
NO_SUMMARY_OPERATIONpublic static final java.lang.String getOperationName(int operation)
operation - the value of the summary operation property.
getSummaryOperation()public static final int getSummaryOperation(java.lang.String operation)
operation - Operation name
SUM,
AVERAGE,
SAMPLE_VARIANCE,
SAMPLE_STANDARD_DEVIATION,
MAXIMUM,
MINIMUM,
COUNT,
POP_VARIANCE,
POP_STANDARD_DEVIATION,
DISTINCT_COUNT,
CORRELATION,
COVARIANCE,
WEIGHTED_AVERAGE,
MEDIAN,
PERCENTILE,
NTH_LARGEST,
NTH_SMALLEST,
MODE,
NTH_MOST_FREQUENT,
PERCENTAGE,
NO_SUMMARY_OPERATIONpublic int getSummaryFieldType()
SUMMARY_REPORT,
SUMMARY_CROSSTAB,
SUMMARY_CHARTpublic void setSummaryFieldType(int type)
type - the type of parent element.SUMMARY_REPORT,
SUMMARY_CROSSTAB,
SUMMARY_CHARTpublic Field getResetField()
java.lang.IllegalStateException - will thrown if changeType is unknown.public void setResetField(Field rstField)
rstField - java.lang.IllegalArgumentException - will thrown if rstField is a GroupField and does not match a group.public Field getChangeField()
java.lang.IllegalStateException - will be thrown if changeType has unknown value;setChangeField(com.inet.report.Field)public void setChangeField(Field changeField)
changeField - java.lang.IllegalArgumentException - will be thrown if changeField is a GroupField and does not match a group.setResetField(com.inet.report.Field)public int getSummaryNth()
public void setSummaryNth(int summaryNth)
NTH_LARGESTNTH_SMALLESTNTH_MOST_FREQUENTPERCENTILE
summaryNth - value of nth property.getSummaryNth(),
setSummaryOperation(int)public void setShowPercentVal(boolean newValue)
newValue - true when the value of this summary field is shown as percent value.public boolean getShowPercentVal()
public boolean getRunningTotal()
setRunningTotal(boolean)public void setRunningTotal(boolean isRunningTotal)
isRunningTotal - the value of the running total property.getRunningTotal()public int getValueType()
getValueType in class FieldField.NUMBER,
Field.CURRENCY,
Field.BOOLEAN,
Field.DATE,
Field.TIME,
Field.STRING,
Field.DATETIMEpublic java.lang.String paramString()
paramString in class Field
public static java.lang.String generateName(java.lang.String field,
java.lang.String group,
int sumType)
field - - name of the field with values to summarizesgroup - - name of the field the values are grouped bysumType - - the type of summary function
generateName(String, String, int, String)
public static java.lang.String generateName(java.lang.String field,
java.lang.String group,
int sumType,
java.lang.String field2)
field - - name of the field with numeric values to summarizesfield2 - - name of the second field, e.g. for Weighted Averagegroup - - name of the field that contains the values are grouped bysumType - - the type of summary function
generateName(String, String, int)public Field getField2nd()
public void setField2nd(Field field2nd)
Field.CURRENCY
and Field.NUMBER are as
value type of this field supported.CORRELATIONCOVARIANCEWEIGHTED_AVERAGE
field2nd - the second field.getField2nd(),
setField(Field),
setSummaryOperation(int)public void setField(Field newField)
MAXIMUMMINIMUMMODENTH_LARGESTNTH_MOST_FREQUENTNTH_SMALLESTCOUNTDISTINCT_COUNTField.CURRENCY and Field.NUMBER as value type:AVERAGESUMMEDIANPERCENTILEPOP_STANDARD_DEVIATIONPOP_VARIANCESAMPLE_STANDARD_DEVIATIONSAMPLE_VARIANCECORRELATIONCOVARIANCEWEIGHTED_AVERAGE
setField in class FieldnewField - the base field for this summary operation.Field.getField(),
setSummaryOperation(int),
Field.getValueType()public void setGroup(Group group)
setGroup in class Fieldgroup - The reference to the group of this field.SummaryField,
GroupField,
Grouppublic boolean equals(java.lang.Object obj)
SummaryField is "equal to" this one.
equals in class java.lang.Objectobj - Object to compare
true if this SummaryField is the same as the SummaryField
argument; false otherwise.
public NodeParser parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
throws FatalParserException
Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
parseElement in interface NodeParsergroup - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group
of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag - The XMLTag to be parsedatts - The set of attributes in the current XMLTagparserMap - The map of current Parser.
FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the
reading of the report.
protected void saveFieldXML2(java.io.PrintWriter pw,
int depth)
pw - the printwriter.depth - the current depth.public Field duplicate(java.lang.String name)
duplicate in class Fieldname - the name the created field should have.
public Validity validate()
validate in interface Validatable
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||