Package com.storedobject.chart
Interface AbstractDataProvider<T>
- Type Parameters:
T- Data class type.
- All Superinterfaces:
ComponentPart,ComponentProperty
- All Known Subinterfaces:
CategoryDataProvider,DataProvider,DateDataProvider,InternalData<T>,TimeDataProvider
- All Known Implementing Classes:
AbstractData,AbstractDataStream,BasicDataProvider,BasicInternalDataProvider,BoxplotData,CandlestickData,CategoryData,Data,DataStream,DateData,DateStream,FunctionData,InternalData.WrappedDataProvider,SankeyData,SerialData,SerialDate,SerialTime,TimeData,TimeStream
Abstract data provider interface. The type of data can be anything that can be used
for charting. In charting, we need to distinguish between "numeric", "date/time", "categories" and "logarithmic"
values types. (See
DataType).- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionasList()Collect all data values into a list.default <D> AbstractDataProvider<D> create(DataType convertedType, BiFunction<T, Integer, D> mappingFunction) Create another data set by applying a mapping function to this data set.default <D> AbstractDataProvider<D> Create another data set by applying a mapping function to this data set.default voidencode(StringBuilder sb, T value) Encode a value for this data.default voidEncode the JSON string with the properties of this.default Comparator<T> Get the value type of the data.default longgetId()Each part should have a unique Id.default ObjectgetMax()Get the maximum value from this data.default ObjectgetMin()Get the minimum value from this data.default StringgetName()Get the name of this part.stream()Data provided by this provider as a stream.default voidvalidate()This method is invoked bySOChartto check if the component or part is valid or not.Methods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, getSerial, setName, setRenderingIndex, setSerial
-
Method Details
-
stream
-
asList
-
getDataType
-
getName
Description copied from interface:ComponentPartGet the name of this part.- Specified by:
getNamein interfaceComponentPart- Returns:
- Name
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Parameters:
sb- Encoded JSON string to be appended to this.
-
encode
Encode a value for this data.- Parameters:
sb- Encoded value will be appended here.value- Value to encode.
-
getId
default long getId()Description copied from interface:ComponentPartEach part should have a unique Id. (It can be a final variable and can be set by callingID.newID().- Specified by:
getIdin interfaceComponentPart- Returns:
- Unique Id.
-
validate
Description copied from interface:ComponentPartThis method is invoked bySOChartto check if the component or part is valid or not.- Specified by:
validatein interfaceComponentPart- Throws:
ChartException- Raises exception if the component or part is not valid.
-
getMin
Get the minimum value from this data. This is used by certain components such asVisualMapto automatically find out the minimum value of a value-based chart.The default implementation tries to use the
Comparatorreturned by thegetComparator()method to determine this value. If noComparatoris available,nullwill be returned.- Returns:
- Minimum value of the data.
-
getMax
Get the maximum value from this data. This is used by certain components such asVisualMapto automatically find out the minimum value of a value-based chart.The default implementation tries to use the
Comparatorreturned by thegetComparator()method to determine this value. If noComparatoris available,nullwill be returned.- Returns:
- Minimum value of the data.
-
getComparator
-
create
default <D> AbstractDataProvider<D> create(DataType convertedType, BiFunction<T, Integer, D> mappingFunction) Create another data set by applying a mapping function to this data set. (Each item and its index are passed to the mapping function).- Type Parameters:
D- Type of data in the target data set.- Parameters:
convertedType- Converted type.mappingFunction- Mapping function.- Returns:
- A new data set with values mapped from this data set.
-
create
Create another data set by applying a mapping function to this data set. (Each item is passed to the mapping function).- Type Parameters:
D- Type of data in the target data set.- Parameters:
convertedType- Converted type.mappingFunction- Mapping function.- Returns:
- A new data set with values mapped from this data set.
-