Klasse SummaryField
java.lang.Object
com.inet.report.Field
com.inet.report.SummaryField
- Alle implementierten Schnittstellen:
NodeParser, com.inet.report.ReferencedObject, com.inet.report.ReferenceHolder, Validatable, Serializable
A summary field summarizes data of other fields in the report. You can print out the
summary with a
This class is part of the
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.- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifikator und TypKlasseBeschreibungstatic enumFOR INTERNAL USE ONLYstatic enumFOR INTERNAL USE ONLYVon Klasse geerbte verschachtelte Klassen/Schnittstellen Field
Field.FieldAttributeTag -
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final intSummaryField calculates average.static final intSummaryField calculates correlation.static final intSummaryField calculates count.static final intSummaryField calculates covariance.protected com.inet.report.DefaultReferenceHoldercontains referenced objectsstatic final intSummaryField calculates distinct count.static final intSummaryField calculates maximum.static final intSummaryField calculates median.static final intSummaryField calculates minimum.static final intSummaryField calculates mode.static final intSummaryField calculates no operation, data will returned originally.static final intSummaryField calculates Nth lagest.static final intSummaryField calculates Nth most frequent.static final intSummaryField calculates Nth smallest.static final intSummaryField calculates percentage.static final intSummaryField calculates percentile.static final intSummaryField calculates population standard deviation.static final intSummaryField calculates population variance.static final intSummaryField calculates sample standard deviation.static final intSummaryField calculates sample varianz.static final intSummaryField calculates sum.static final intIndicates that this summary field belongs to the chart objectstatic final intIndicates that this summary field belongs to the crosstab column objectstatic final intIndicates that this summary field belongs to the report objectstatic final intSummaryField calculates weigted average.Von Klasse geerbte Felder 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 -
Konstruktorübersicht
KonstruktorenModifikatorKonstruktorBeschreibungprotectedSummaryField(com.inet.report.RendererBase ren) FOR INTERNAL USE ONLY -
Methodenübersicht
Modifikator und TypMethodeBeschreibungfinal voidaddReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLYvoidchangeAliasName(String oldAlias, String newAlias) FOR INTERNAL USE ONLYDuplicates this field with all its settings and returns the created Field with the given name.booleanIndicates whether some otherSummaryFieldis "equal to" this one.static StringgenerateName(String field, String group, int sumType) Generates the name of a summary field, i.e.static StringgenerateName(String field, String group, int sumType, String field2) Generates the name of a summary field, i.e.Running total changes if this field value was changed.Some Summaries need two fields for calculation, i.e. weighted average, correlation etc.static final StringgetOperationName(int operation) Returns the name of the operation by id.final intFOR INTERNAL USE ONLYfinal intFOR INTERNAL USE ONLYfinal com.inet.report.ReferencedObject[]FOR INTERNAL USE ONLYRunning total is reset if this field value was changed.booleanReturns the running total property of this SummaryField.booleanHow result of summary operation is shown.intIndicates to which object this summary field belongs.intReturns the Nth value in Nth-functions.intReturns the value of the property 'summary operation'.static final intgetSummaryOperation(String operation) Returns the operation constant according to the nameintReturns the value type (or return type) of the field.
NOTE:If DefaultAttribute is used within the formula it has to be set before calling this method.booleanFOR INTERNAL USE ONLY Returns whether this is an internal (not editable) summary fieldReturns a prettified output of this field's name and type.parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLfinal voidremoveReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLYvoidFOR INTERNAL USE ONLYprotected voidsaveFieldXML2(PrintWriter pw, int depth) Saves SummaryField attributesvoidsetChangeField(Field changeField) Running total changes if this field value was changed.voidSets the field witch values will be used by result calculating of this summary field.
Note: some summary operations supports only specific value type of field.
Following operations supports all value types:
MAXIMUM
MINIMUM
MODE
NTH_LARGEST
NTH_MOST_FREQUENT
NTH_SMALLEST
COUNT
DISTINCT_COUNT
Following operations supports onlyField.CURRENCYandField.NUMBERas value type:
AVERAGE
SUM
MEDIAN
PERCENTILE
POP_STANDARD_DEVIATION
POP_VARIANCE
SAMPLE_STANDARD_DEVIATION
SAMPLE_VARIANCE
CORRELATION
COVARIANCE
WEIGHTED_AVERAGEvoidsetField2nd(Field field2nd) Sets the second field.voidSets the group this field should associated with.voidSets the name of the summary field.voidFOR INTERNAL USE ONLYvoidsetResetField(Field rstField) Running total Field reset if this field value was changed.voidsetRunningTotal(boolean isRunningTotal) Sets the running total property of this SummaryField.voidsetShowPercentVal(boolean newValue) Sets how the result of summary operation is shown.voidsetSummaryFieldType(int type) Sets to which object this summary field belongs.voidsetSummaryNth(int summaryNth) Sets the Nth value in Nth-functions.
Following operations needs the 'nth' parameter:
NTH_LARGEST
NTH_SMALLEST
NTH_MOST_FREQUENT
PERCENTILEfinal voidsetSummaryOperation(int operation) Sets the value of the property 'summary operation'.validate()Check if the object is valid and returns the state and details of possible errors.Von Klasse geerbte Methoden Field
addReferenceHolder, checkNameExists, extractReference, getField, getGroup, getName, getPlaceholderName, getRealReferenceCount, getReferenceHolderCount, getReferenceHolders, getRefName, getType, indexOf, isDOMParser, isUsed, parseDOM, parseEndElement, parseText, removeReferenceHolder, rename, setValueType, trimAwayBrackets
-
Felddetails
-
SUM
public static final int SUMSummaryField calculates sum.- Siehe auch:
-
AVERAGE
public static final int AVERAGESummaryField calculates average.- Seit:
- 6.0
- Siehe auch:
-
SAMPLE_VARIANCE
public static final int SAMPLE_VARIANCESummaryField calculates sample varianz.- Seit:
- 6.0
- Siehe auch:
-
SAMPLE_STANDARD_DEVIATION
public static final int SAMPLE_STANDARD_DEVIATIONSummaryField calculates sample standard deviation.- Seit:
- 6.0
- Siehe auch:
-
MAXIMUM
public static final int MAXIMUMSummaryField calculates maximum.- Seit:
- 6.0
- Siehe auch:
-
MINIMUM
public static final int MINIMUMSummaryField calculates minimum.- Seit:
- 6.0
- Siehe auch:
-
COUNT
public static final int COUNTSummaryField calculates count.- Seit:
- 6.0
- Siehe auch:
-
POP_VARIANCE
public static final int POP_VARIANCESummaryField calculates population variance.- Seit:
- 6.0
- Siehe auch:
-
POP_STANDARD_DEVIATION
public static final int POP_STANDARD_DEVIATIONSummaryField calculates population standard deviation.- Seit:
- 6.0
- Siehe auch:
-
DISTINCT_COUNT
public static final int DISTINCT_COUNTSummaryField calculates distinct count.- Seit:
- 6.0
- Siehe auch:
-
CORRELATION
public static final int CORRELATIONSummaryField calculates correlation.- Seit:
- 6.0
- Siehe auch:
-
COVARIANCE
public static final int COVARIANCESummaryField calculates covariance.- Seit:
- 6.0
- Siehe auch:
-
WEIGHTED_AVERAGE
public static final int WEIGHTED_AVERAGESummaryField calculates weigted average.- Seit:
- 6.0
- Siehe auch:
-
MEDIAN
public static final int MEDIANSummaryField calculates median.- Seit:
- 6.0
- Siehe auch:
-
PERCENTILE
public static final int PERCENTILESummaryField calculates percentile.- Seit:
- 6.0
- Siehe auch:
-
NTH_LARGEST
public static final int NTH_LARGESTSummaryField calculates Nth lagest.- Seit:
- 6.0
- Siehe auch:
-
NTH_SMALLEST
public static final int NTH_SMALLESTSummaryField calculates Nth smallest.- Seit:
- 6.0
- Siehe auch:
-
MODE
public static final int MODESummaryField calculates mode.- Seit:
- 6.0
- Siehe auch:
-
NTH_MOST_FREQUENT
public static final int NTH_MOST_FREQUENTSummaryField calculates Nth most frequent.- Seit:
- 6.0
- Siehe auch:
-
PERCENTAGE
public static final int PERCENTAGESummaryField calculates percentage.- Seit:
- 6.0
- Siehe auch:
-
NO_SUMMARY_OPERATION
public static final int NO_SUMMARY_OPERATIONSummaryField calculates no operation, data will returned originally.- Seit:
- 6.0
- Siehe auch:
-
SUMMARY_REPORT
public static final int SUMMARY_REPORTIndicates that this summary field belongs to the report object- Siehe auch:
-
SUMMARY_CROSSTAB
public static final int SUMMARY_CROSSTABIndicates that this summary field belongs to the crosstab column object- Siehe auch:
-
SUMMARY_CHART
public static final int SUMMARY_CHARTIndicates that this summary field belongs to the chart object- Siehe auch:
-
defaultHolder
protected com.inet.report.DefaultReferenceHolder defaultHoldercontains referenced objects
-
-
Konstruktordetails
-
SummaryField
protected SummaryField(com.inet.report.RendererBase ren) FOR INTERNAL USE ONLY
-
-
Methodendetails
-
setName
Sets the name of the summary field. The name is a unique identifier of this field.- Angegeben von:
setNamein KlasseField- Parameter:
name- the name for this summary field.- Löst aus:
IllegalArgumentException- will thrown if the name already exists or if the name isnullor empty.- Seit:
- 6.0
-
setSummaryOperation
public final void setSummaryOperation(int operation) Sets the value of the property 'summary operation'.- Parameter:
operation- The new value of the property 'summary operation'.- Seit:
- 6.0
- Siehe auch:
-
getSummaryOperation
public int getSummaryOperation()Returns the value of the property 'summary operation'.- Gibt zurück:
- The current value of the property 'summary operation'.
- Seit:
- 6.0
- Siehe auch:
-
getOperationName
Returns the name of the operation by id.- Parameter:
operation- the value of the summary operation property.- Gibt zurück:
- String The name of the summary operation
- Seit:
- 6.0
- Siehe auch:
-
getSummaryOperation
Returns the operation constant according to the name- Parameter:
operation- Operation name- Gibt zurück:
- operation constant
- Seit:
- 8.1
- Siehe auch:
-
getSummaryFieldType
public int getSummaryFieldType()Indicates to which object this summary field belongs.- Gibt zurück:
- The summary type
- Seit:
- 6.0
- Siehe auch:
-
setSummaryFieldType
public void setSummaryFieldType(int type) Sets to which object this summary field belongs.- Parameter:
type- the type of parent element.- Seit:
- 6.0
- Siehe auch:
-
getResetField
Running total is reset if this field value was changed.- Gibt zurück:
- null
- a FormulaField
- a DatabaseField
- a GroupField
- Löst aus:
IllegalStateException- will thrown if changeType is unknown.- Seit:
- 6.0
-
setResetField
Running total Field reset if this field value was changed.- Parameter:
rstField-- no field is needed, summary will reset on each record
- resetField have to be an instance of FormulaField
- resetField have to be an instance of DatabaseField
- resetField have to be an instance of GroupField
- Löst aus:
IllegalArgumentException- will thrown if rstField is a GroupField and does not match a group.- Seit:
- 6.0
-
getChangeField
Running total changes if this field value was changed.- Gibt zurück:
- null
- a FormulaField
- a DatabaseField
- a GroupField
- Löst aus:
IllegalStateException- will be thrown if changeType has unknown value;- Seit:
- 6.0
- Siehe auch:
-
setChangeField
Running total changes if this field value was changed.- Parameter:
changeField-- no field is needed, summary will be changed on each record
- changeField have to be an instance of FormulaField
- changeField have to be an instance of DatabaseField
- changeField have to be an instance of GroupField
- Löst aus:
IllegalArgumentException- will be thrown if changeField is a GroupField and does not match a group.- Seit:
- 6.0
- Siehe auch:
-
getSummaryNth
public int getSummaryNth()Returns the Nth value in Nth-functions.- Gibt zurück:
- value of nth property.
- Seit:
- 6.0
-
setSummaryNth
public void setSummaryNth(int summaryNth) Sets the Nth value in Nth-functions.
Following operations needs the 'nth' parameter:
NTH_LARGEST
NTH_SMALLEST
NTH_MOST_FREQUENT
PERCENTILE- Parameter:
summaryNth- value of nth property.- Seit:
- 6.0
- Siehe auch:
-
setShowPercentVal
public void setShowPercentVal(boolean newValue) Sets how the result of summary operation is shown.- Parameter:
newValue- true when the value of this summary field is shown as percent value.- Seit:
- 6.0
-
getShowPercentVal
public boolean getShowPercentVal()How result of summary operation is shown.- Gibt zurück:
- true when the value of this summary field is shown as percent value.
- Seit:
- 6.0
-
getRunningTotal
public boolean getRunningTotal()Returns the running total property of this SummaryField. If it not the running total then it can have a group field, only. A running total SummaryField can change its value for each row. If it is not a running total Field then the value is identical for all rows in one group.- Gibt zurück:
- true if this is a running total.
- Seit:
- 6.0
- Siehe auch:
-
setRunningTotal
public void setRunningTotal(boolean isRunningTotal) Sets the running total property of this SummaryField.- Parameter:
isRunningTotal- the value of the running total property.- Seit:
- 6.0
- Siehe auch:
-
getValueType
public int getValueType()Returns the value type (or return type) of the field.
NOTE:If DefaultAttribute is used within the formula it has to be set before calling this method. A null-value will cause an exception here. If you don't know the exact value of the DefaultAttribute you may use a dummy-value for getValueType. The reason is that getValueType only regards the type of object not their value.- Setzt außer Kraft:
getValueTypein KlasseField- Gibt zurück:
- The value of the property 'value type'.
- Siehe auch:
-
paramString
Returns a prettified output of this field's name and type.- Setzt außer Kraft:
paramStringin KlasseField- Gibt zurück:
- Prettified output of this field's name and type.
-
generateName
Generates the name of a summary field, i.e. "Count of OrderID".
For summary functions like "Weighted Average" you can use the method generateName with 4 parameters.- Parameter:
field- - name of the field with values to summarizesgroup- - name of the field the values are grouped bysumType- - the type of summary function- Gibt zurück:
- String - the generated name
- Seit:
- 6.0
- Siehe auch:
-
generateName
Generates the name of a summary field, i.e. "Count of OrderID, CustomerID".
Use this method for summary functions like "Weighted Average" or "Correlation" etc.- Parameter:
field- - name of the field with numeric values to summarizesgroup- - name of the field that contains the values are grouped bysumType- - the type of summary functionfield2- - name of the second field, e.g. for Weighted Average- Gibt zurück:
- String - the generated name
- Seit:
- 6.0
- Siehe auch:
-
getField2nd
Some Summaries need two fields for calculation, i.e. weighted average, correlation etc. Returns the 2nd field used for weights in weighted average, correlation between the field returned by getField() and the field returned by this function.- Gibt zurück:
- Field
- Seit:
- 6.0
-
setField2nd
Sets the second field. The second field is used as weights in weighted average or as correlation between the field and second field. OnlyField.CURRENCYandField.NUMBERare as value type of this field supported.
Following summary operations needs first and second fields for calculation:
CORRELATION
COVARIANCE
WEIGHTED_AVERAGE
All others ignore this property.- Parameter:
field2nd- the second field.- Seit:
- 6.0
- Siehe auch:
-
changeAliasName
-
addReferencedObject
public final void addReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY- Angegeben von:
addReferencedObjectin Schnittstellecom.inet.report.ReferenceHolder- Seit:
- 6.0
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()FOR INTERNAL USE ONLY- Angegeben von:
getReferencedObjectsin Schnittstellecom.inet.report.ReferenceHolder
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()FOR INTERNAL USE ONLY- Angegeben von:
getRealReferencedObjectCountin Schnittstellecom.inet.report.ReferenceHolder- Seit:
- 6.0
-
getReferencedObjectCount
public final int getReferencedObjectCount()FOR INTERNAL USE ONLY- Angegeben von:
getReferencedObjectCountin Schnittstellecom.inet.report.ReferenceHolder
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference) FOR INTERNAL USE ONLY- Angegeben von:
removeReferencedObjectin Schnittstellecom.inet.report.ReferenceHolder- Seit:
- 6.0
-
setReferences
public void setReferences()FOR INTERNAL USE ONLY- Angegeben von:
setReferencesin Schnittstellecom.inet.report.ReferenceHolder
-
resetReferences
public void resetReferences()FOR INTERNAL USE ONLY- Angegeben von:
resetReferencesin Schnittstellecom.inet.report.ReferenceHolder
-
setField
Sets the field witch values will be used by result calculating of this summary field.
Note: some summary operations supports only specific value type of field.
Following operations supports all value types:
MAXIMUM
MINIMUM
MODE
NTH_LARGEST
NTH_MOST_FREQUENT
NTH_SMALLEST
COUNT
DISTINCT_COUNT
Following operations supports onlyField.CURRENCYandField.NUMBERas value type:
AVERAGE
SUM
MEDIAN
PERCENTILE
POP_STANDARD_DEVIATION
POP_VARIANCE
SAMPLE_STANDARD_DEVIATION
SAMPLE_VARIANCE
CORRELATION
COVARIANCE
WEIGHTED_AVERAGE -
setGroup
Sets the group this field should associated with. Use this method for setting the group in summary field. GroupFields are generated and initialised automatically at group creation time. You do not need to change the group reference of this fields. -
equals
Indicates whether some otherSummaryFieldis "equal to" this one. -
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLParses 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.
- Angegeben von:
parseElementin SchnittstelleNodeParser- Setzt außer Kraft:
parseElementin KlasseField- Parameter:
group- 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.- Gibt zurück:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Löst aus:
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.
-
saveFieldXML2
Saves SummaryField attributes- Angegeben von:
saveFieldXML2in KlasseField- Parameter:
pw- the printwriter.depth- the current depth.- Seit:
- 8.1
-
duplicate
Duplicates this field with all its settings and returns the created Field with the given name. Note that the new formula field will not initially be referenced by any other report objects. If you duplicate a property formula, you will have to set the new formula as a separate property formula. -
validate
Check if the object is valid and returns the state and details of possible errors.- Angegeben von:
validatein SchnittstelleValidatable- Gibt zurück:
- the current state, never null.
-
isInternalField
public boolean isInternalField()FOR INTERNAL USE ONLY Returns whether this is an internal (not editable) summary field- Gibt zurück:
- whether this is an internal (not editable) summary field
-