public class SummaryField extends Field implements com.inet.report.ReferenceHolder, Validatable
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.Modifier and Type | Field and Description |
---|---|
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
|
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
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
checkNameExists, extractReference, getField, getGroup, getName, getPlaceholderName, getRefName, getType, indexOf, setValueType, trimAwayBrackets
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
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
public void setName(java.lang.String name)
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_OPERATION
public 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_OPERATION
public 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 nameSUM
,
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_OPERATION
public int getSummaryFieldType()
SUMMARY_REPORT
,
SUMMARY_CROSSTAB
,
SUMMARY_CHART
public void setSummaryFieldType(int type)
type
- the type of parent element.SUMMARY_REPORT
,
SUMMARY_CROSSTAB
,
SUMMARY_CHART
public 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_LARGEST
NTH_SMALLEST
NTH_MOST_FREQUENT
PERCENTILE
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 Field
Field.NUMBER
,
Field.CURRENCY
,
Field.BOOLEAN
,
Field.DATE
,
Field.TIME
,
Field.STRING
,
Field.DATETIME
public 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 functiongenerateName(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 functiongenerateName(String, String, int)
public Field getField2nd()
public void setField2nd(Field field2nd)
Field.CURRENCY
and Field.NUMBER
are as
value type of this field supported.CORRELATION
COVARIANCE
WEIGHTED_AVERAGE
field2nd
- the second field.getField2nd()
,
setField(Field)
,
setSummaryOperation(int)
public void setField(Field newField)
MAXIMUM
MINIMUM
MODE
NTH_LARGEST
NTH_MOST_FREQUENT
NTH_SMALLEST
COUNT
DISTINCT_COUNT
Field.CURRENCY
and Field.NUMBER
as value type:AVERAGE
SUM
MEDIAN
PERCENTILE
POP_STANDARD_DEVIATION
POP_VARIANCE
SAMPLE_STANDARD_DEVIATION
SAMPLE_VARIANCE
CORRELATION
COVARIANCE
WEIGHTED_AVERAGE
setField
in class Field
newField
- the base field for this summary operation.Field.getField()
,
setSummaryOperation(int)
,
Field.getValueType()
public void setGroup(Group group)
setGroup
in class Field
group
- The reference to the group of this field.SummaryField
,
GroupField
,
Group
public boolean equals(java.lang.Object obj)
SummaryField
is "equal to" this one.obj
- Object to comparetrue
if this SummaryField
is the same as the SummaryField
argument; false
otherwise.public Field duplicate(java.lang.String name)
public Validity validate()
validate
in interface Validatable
Copyright © 1999-2020 by i-net software GmbH