Package com.storedobject.chart
Class AbstractData<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
com.storedobject.chart.AbstractData<T>
- Type Parameters:
T- Data type.
- All Implemented Interfaces:
AbstractDataProvider<T>,ComponentPart,ComponentProperty,Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,SequencedCollection<T>
- Direct Known Subclasses:
BoxplotData,CandlestickData,CategoryData,Data,DateData,SankeyData,TimeData
Representation of data as a
List. 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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.chart.AbstractDataProvider
AbstractDataProvider.NumberComparator -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionAbstractData(DataType dataType, T... data) Constructor.AbstractData(Class<T> dataClass, T... data) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionasList()Collect all data values into a list.final DataTypeGet the data type.getName()Get the name of this data set.final intGet the current serial number (Serial number used for internal purposes only).voidSet a name for this data set.final voidsetSerial(int serial) Set a serial number (Serial number used for internal purposes only).stream()Data provided by this provider as a stream.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.storedobject.chart.AbstractDataProvider
create, create, encode, encodeJSON, getComparator, getId, getMax, getMin, validateMethods inherited from interface java.util.Collection
parallelStream, toArrayMethods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setRenderingIndexMethods inherited from interface java.util.List
containsAll, reversed
-
Constructor Details
-
AbstractData
Constructor.- Parameters:
dataClass- Data class.data- Initial data to add
-
AbstractData
Constructor.- Parameters:
dataType- Data type.data- Initial data to add
-
-
Method Details
-
getDataType
Get the data type.- Specified by:
getDataTypein interfaceAbstractDataProvider<T>- Returns:
- Data type.
-
getSerial
public final int getSerial()Description copied from interface:ComponentPartGet the current serial number (Serial number used for internal purposes only). The serial number set by theComponentPart.setSerial(int)method should be returned by this method.- Specified by:
getSerialin interfaceComponentPart- Returns:
- Current serial number.
-
setSerial
public final void setSerial(int serial) Description copied from interface:ComponentPartSet a serial number (Serial number used for internal purposes only). The implementation of this method must be in such a way that the serial number set here must be returned by theComponentPart.getSerial()method.- Specified by:
setSerialin interfaceComponentPart- Parameters:
serial- Serial number to set.
-
getName
Get the name of this data set.- Specified by:
getNamein interfaceAbstractDataProvider<T>- Specified by:
getNamein interfaceComponentPart- Returns:
- Name.
-
setName
Set a name for this data set.- Specified by:
setNamein interfaceComponentPart- Parameters:
name- Name to set.
-
asList
Description copied from interface:AbstractDataProviderCollect all data values into a list.- Specified by:
asListin interfaceAbstractDataProvider<T>- Returns:
- Values as a list.
-
stream
Description copied from interface:AbstractDataProviderData provided by this provider as a stream.Note: The
Streamshould be reproducible after a terminal operation.- Specified by:
streamin interfaceAbstractDataProvider<T>- Specified by:
streamin interfaceCollection<T>- Returns:
- Stream of data values.
-