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,java.io.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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.inet.report.chart.dataset.BaseDataset
TOKEN_DATASET
-
-
Constructor Summary
Constructors Constructor Description ForAllRecordsDataset(Chart2 chart)Creates a new empty dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddDataField(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 GroupgetCategoryGroup()Returns the category group.Chart2getChart()Returns the parent chart of this dataset.SummaryFieldgetDataField(int index)Returns the summary field at the specified position in the list.SummaryFieldgetDataField(java.lang.String name)Returns the summary field with the specified name ornullif the summary field with this name not found in the list.java.util.ListgetDataFields()Returns the data fields of this dataset as list.intgetDataFieldsCount()Returns the count of data fields in this dataset.com.inet.report.chart.dataset.LabelProvidergetLabelProvider()Returns the LabelProvider responsible for providing the title, footnote, and axis labelsprotected java.lang.StringgetName()FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.voidremoveAllDataFields()Removes all data fields from this dataset.voidremoveDataField(int index)Removes a data field at the specified position in the list.voidupdateReferences()FOR INTERNAL USE ONLY.java.lang.Stringverify(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 Detail
-
ForAllRecordsDataset
public ForAllRecordsDataset(Chart2 chart)
Creates a new empty dataset.- Parameters:
chart- the chart (nullnot permitted)- Since:
- 8.0
-
-
Method Detail
-
getChart
public Chart2 getChart()
Returns the parent chart of this dataset.- Specified by:
getChartin interfaceBaseDataset- Returns:
- the chart.
-
addDataField
public boolean 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 newSummaryFieldwith 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:
true(as per the general contract of Collection.add).- Throws:
java.lang.IllegalArgumentException- if the required second field or the field arenullor have an unsupported value type.java.lang.IllegalArgumentException- if parameter nth is less than zero.- Since:
- 8.0
- See Also:
getDataField(int),getDataFieldsCount(),removeAllDataFields(),removeDataField(int),SummaryField.setSummaryOperation(int),SummaryField.setField(Field),SummaryField.setField2nd(Field),SummaryField.setSummaryNth(int)
-
getDataField
public SummaryField getDataField(int index)
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:
java.lang.IndexOutOfBoundsException- if index is out of range.- Since:
- 8.0
-
getDataField
public SummaryField getDataField(java.lang.String name)
Returns the summary field with the specified name ornullif the summary field with this name not found in the list. Testing for equality using the case sensitiveequalsmethod.- Specified by:
getDataFieldin interfaceBaseDataset- Parameters:
name- the searched name of summary field (nullnot permitted)- Returns:
- the summary field with the specified name or
null. - See Also:
BaseDataset.getDataFields()
-
getDataFields
public java.util.List getDataFields()
Returns the data fields of this dataset as list.- Specified by:
getDataFieldsin interfaceBaseDataset- Returns:
- the list of data fields
- See Also:
BaseDataset.getDataField(String)
-
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:
java.lang.IndexOutOfBoundsException- if index out of range.- Since:
- 8.0
- See Also:
addDataField(int, Field, Field, int),getDataField(int),getDataFieldsCount(),removeAllDataFields()
-
removeAllDataFields
public void removeAllDataFields()
Removes all data fields from this dataset.- Since:
- 8.0
- See Also:
addDataField(int, Field, Field, int),getDataField(int),getDataFieldsCount(),removeDataField(int)
-
getDataFieldsCount
public int getDataFieldsCount()
Returns the count of data fields in this dataset.- Returns:
- the count
- Since:
- 8.0
- See Also:
addDataField(int, Field, Field, int),getDataField(int),removeAllDataFields(),removeDataField(int)
-
getCategoryGroup
protected Group getCategoryGroup()
Returns the category group. The category group is the first group of chart.- Returns:
- the group
- Since:
- 8.0
-
verify
public java.lang.String verify(ChartStyle style)
Verifies the group and sum properties of current dataset.- Specified by:
verifyin 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:
updateReferencesin interfaceBaseDataset
-
getName
protected java.lang.String 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:
getLabelProviderin interfaceBaseDataset- Returns:
- the LabelProvider responsible for providing the title, footnote, and axis labels
-
-