Package com.storedobject.chart
Class FunctionData
java.lang.Object
com.storedobject.chart.FunctionData
- All Implemented Interfaces:
AbstractDataProvider<Double>,ComponentPart,ComponentProperty
Representation of data as a mathematical function of another data or stream of values.
The resulting data is always of
Double type.- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.chart.AbstractDataProvider
AbstractDataProvider.NumberComparator -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionDatacreate(double startingValue, double endingValue, double step) Create aFunctionDatathat generates a sequence of double values as its output.static FunctionDatacreate(int startingValue, int endingValue) Create aFunctionDatathat generates a sequence of integer equivalents as its output.static FunctionDatacreate(int startingValue, int endingValue, int step) Create aFunctionDatathat generates a sequence of integer equivalents as its output.static <T> FunctionDatacreate(AbstractDataProvider<T> xValues, ToDoubleFunction<T> converter) Create aFunctionDatathat generates values by converting a stream of another set of values.static FunctionDatacreate(DoubleFunction<Double> converter, double startingValue, double endingValue) Create a mathematical function that generatesFunctionDatafor a given range of double values.static FunctionDatacreate(DoubleFunction<Double> converter, double startingValue, double endingValue, double step) Create a mathematical function that generatesFunctionDatafor a given range of double values.static FunctionDatacreate(IntToDoubleFunction converter, int startingValue, int endingValue) Create a mathematical function that generatesFunctionDatafor a given range of integer equivalents.static FunctionDatacreate(IntToDoubleFunction converter, int startingValue, int endingValue, int step) Create a mathematical function that generatesFunctionDatafor a given range of integers.static <T> FunctionDatacreate(Supplier<Stream<T>> streamSupplier, ToDoubleFunction<T> converter) Create aFunctionDatathat generates values by converting a stream of another set of values.final DataTypeGet the data type.final StringgetName()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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.AbstractDataProvider
asList, create, create, encode, encodeJSON, getComparator, getId, getMax, getMin, validateMethods inherited from interface com.storedobject.chart.ComponentPart
className, getRenderingIndex, setRenderingIndex
-
Method Details
-
create
public static <T> FunctionData create(AbstractDataProvider<T> xValues, ToDoubleFunction<T> converter) Create aFunctionDatathat generates values by converting a stream of another set of values.- Parameters:
xValues- Data to convert to double values.converter- Converter function.
-
create
public static <T> FunctionData create(Supplier<Stream<T>> streamSupplier, ToDoubleFunction<T> converter) Create aFunctionDatathat generates values by converting a stream of another set of values.- Parameters:
streamSupplier- Stream supplier that supplies the stream of data to convert to double values.converter- Converter function.
-
create
Create aFunctionDatathat generates a sequence of integer equivalents as its output.- Parameters:
startingValue- Starting value of the integer.endingValue- Ending value of the integer.- Returns:
- Function data created.
-
create
Create aFunctionDatathat generates a sequence of integer equivalents as its output.- Parameters:
startingValue- Starting value of the integer.endingValue- Ending value of the integer.step- Incrementing step (Could be negative and in that case, startingValue > endingValue).- Returns:
- Function data created.
-
create
public static FunctionData create(IntToDoubleFunction converter, int startingValue, int endingValue) Create a mathematical function that generatesFunctionDatafor a given range of integer equivalents.- Parameters:
converter- Converter function.startingValue- Starting value of the integer.endingValue- Ending value of the integer.- Returns:
- Function data created.
-
create
public static FunctionData create(IntToDoubleFunction converter, int startingValue, int endingValue, int step) Create a mathematical function that generatesFunctionDatafor a given range of integers.- Parameters:
converter- Converter function.startingValue- Starting value of the integer.endingValue- Ending value of the integer.step- Incrementing step (Could be negative and in that case, startingValue > endingValue).- Returns:
- Function data created.
-
create
Create aFunctionDatathat generates a sequence of double values as its output.- Parameters:
startingValue- Starting value.endingValue- Ending value.step- Incrementing step (Could be negative and in that case, startingValue > endingValue).- Returns:
- Function data created.
-
create
public static FunctionData create(DoubleFunction<Double> converter, double startingValue, double endingValue) Create a mathematical function that generatesFunctionDatafor a given range of double values.- Parameters:
startingValue- Starting value.endingValue- Ending value.- Returns:
- Function data created.
-
create
public static FunctionData create(DoubleFunction<Double> converter, double startingValue, double endingValue, double step) Create a mathematical function that generatesFunctionDatafor a given range of double values.- Parameters:
converter- Converter function.startingValue- Starting value.endingValue- Ending value.step- Incrementing step (Could be negative and in that case, startingValue > endingValue).- Returns:
- Function data created.
-
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<Double>- Returns:
- Stream of data values.
-
getDataType
Get the data type.- Specified by:
getDataTypein interfaceAbstractDataProvider<Double>- 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<Double>- Specified by:
getNamein interfaceComponentPart- Returns:
- Name.
-
setName
Set a name for this data set.- Specified by:
setNamein interfaceComponentPart- Parameters:
name- Name to set.
-