Package com.inet.report.chart.dataset
Class ForAllRecordsDataset
java.lang.Object
com.inet.report.chart.dataset.AbstractDataset
com.inet.report.chart.dataset.ForAllRecordsDataset
- All Implemented Interfaces:
BaseDataset
,PieDataset
,StandardDataset
,Serializable
- Direct Known Subclasses:
ForEachRecordDataset
,OneGroupDataset
public class ForAllRecordsDataset
extends com.inet.report.chart.dataset.AbstractDataset
implements StandardDataset, PieDataset
This is a dataset used by standard (bar, line, area) and pie charts.
This evaluates 'for all records' data for several data fields.
- Since:
- 8.0
- See Also:
-
Field Summary
Fields inherited from interface com.inet.report.chart.dataset.BaseDataset
TOKEN_DATASET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nonnull SummaryField
addDataField
(int summaryOperation, Field field, Field field2nd, int nth) Adds a data field to the list of fields whose values will be calculated by the summary operation and shown in the chart as bar length for example.protected Group
Returns the category group.getChart()
Returns the parent chart of this dataset.getDataField
(int index) Returns the summary field at the specified position in the list.getDataField
(String name) Returns the summary field with the specified name ornull
if the summary field with this name not found in the list.Returns the data fields of this dataset as list.int
Returns the count of data fields in this dataset.com.inet.report.chart.dataset.LabelProvider
Returns the LabelProvider responsible for providing the title, footnote, and axis labelsprotected String
getName()
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.void
Removes all data fields from this dataset.void
removeDataField
(int index) Removes a data field at the specified position in the list.void
FOR INTERNAL USE ONLY.verify
(ChartStyle style) Verifies the group and sum properties of current dataset.Methods inherited from class com.inet.report.chart.dataset.AbstractDataset
getReferencedObject, saveGroups, saveProperties, saveSummaryFields
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inet.report.chart.dataset.BaseDataset
getReferencedObject
-
Constructor Details
-
ForAllRecordsDataset
Creates a new empty dataset.- Parameters:
chart
- the chart (null
not permitted)- Since:
- 8.0
-
-
Method Details
-
getChart
Returns the parent chart of this dataset.- Specified by:
getChart
in interfaceBaseDataset
- Returns:
- the chart.
-
addDataField
@Nonnull public @Nonnull SummaryField addDataField(int summaryOperation, Field field, Field field2nd, int nth) Adds a data field to the list of fields whose values will be calculated by the summary operation and shown in the chart as bar length for example. This will creates a newSummaryField
with the given parameters.
For more information about the supported value types of the field and about using parameters 'field2nd' and 'nth' seeSummaryField
.- Parameters:
summaryOperation
- the summary operationfield
- the data fieldfield2nd
- the second data field, user for example for weights in weighted averageSummaryField.WEIGHTED_AVERAGE
.nth
- the nth parameter, used for example by the summary operationSummaryField.NTH_LARGEST
- Returns:
- the created summary field.
- Throws:
IllegalArgumentException
- if the required second field or the field arenull
or have an unsupported value type.IllegalArgumentException
- if parameter nth is less than zero.- Since:
- 8.0
- See Also:
-
getDataField
Returns the summary field at the specified position in the list.- Parameters:
index
- index of summary field to return- Returns:
- the summary field at the specified position in the list.
- Throws:
IndexOutOfBoundsException
- if index is out of range.- Since:
- 8.0
-
getDataField
Returns the summary field with the specified name ornull
if the summary field with this name not found in the list. Testing for equality using the case sensitiveequals
method.- Specified by:
getDataField
in interfaceBaseDataset
- Parameters:
name
- the searched name of summary field (null
not permitted)- Returns:
- the summary field with the specified name or
null
. - See Also:
-
getDataFields
Returns the data fields of this dataset as list.- Specified by:
getDataFields
in interfaceBaseDataset
- Returns:
- the list of data fields
- See Also:
-
removeDataField
public void removeDataField(int index) Removes a data field at the specified position in the list. Note: this dataset is incomplete without any data fields and cannot be used by chart.- Parameters:
index
- the specified position- Throws:
IndexOutOfBoundsException
- if index out of range.- Since:
- 8.0
- See Also:
-
removeAllDataFields
public void removeAllDataFields()Removes all data fields from this dataset.- Since:
- 8.0
- See Also:
-
getDataFieldsCount
public int getDataFieldsCount()Returns the count of data fields in this dataset.- Returns:
- the count
- Since:
- 8.0
- See Also:
-
getCategoryGroup
Returns the category group. The category group is the first group of chart.- Returns:
- the group
- Since:
- 8.0
-
verify
Verifies the group and sum properties of current dataset.- Specified by:
verify
in interfaceBaseDataset
- Parameters:
style
- the chart style- Returns:
- the error message or empty string if all properties are correct.
-
updateReferences
public void updateReferences()FOR INTERNAL USE ONLY. Updates the references of this dataset.- Specified by:
updateReferences
in interfaceBaseDataset
-
getName
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.- Returns:
- name of the XML attribute for this dataset
-
getLabelProvider
public com.inet.report.chart.dataset.LabelProvider getLabelProvider()Returns the LabelProvider responsible for providing the title, footnote, and axis labels- Specified by:
getLabelProvider
in interfaceBaseDataset
- Returns:
- the LabelProvider responsible for providing the title, footnote, and axis labels
-