Class XYChartDataBuilder<X,Y>
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.XYChartDataBuilder<X,Y>
The
XYChartDataBuilder class constructs instances of the Data class
and offers a fluent interface for creating and configuring it.
This class includes a static create method that accepts the same arguments as the original Data constructor
and returns an instance of the XYChartDataBuilder.
You can use method chaining to call the builder methods for configuring the Data.
Finally, invoke the build method to generate an instance of the Data class.
Note that intermediate builder methods are not evaluated until the build method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionapply(Consumer<XYChart.Data<X, Y>> func) Applies a function to the Data instance being constructed.build()Builds and returns an instance of theDataclass.static <X,Y> XYChartDataBuilder <X, Y> create()Returns an instance of theXYChartDataBuilder<X, Y>.static <X,Y> XYChartDataBuilder <X, Y> create(X xValue, Y yValue) Accepts the constructor arguments ofData(X, Y)and returns an instance ofXYChartDataBuilder<X, Y>.static <X,Y> XYChartDataBuilder <X, Y> Accepts the constructor arguments ofData(X, Y, Object)and returns an instance ofXYChartDataBuilder<X, Y>.extraValue(Object value) A builder method that invokes thesetExtraValuemethod on the instance being constructed.Applies a function to theextraValuePropertyof the instance being constructed.A builder method that invokes thesetNodemethod on the instance being constructed.Applies a function to thenodePropertyof the instance being constructed.A builder method that invokes thesetXValuemethod on the instance being constructed.Applies a function to theXValuePropertyof the instance being constructed.A builder method that invokes thesetYValuemethod on the instance being constructed.Applies a function to theYValuePropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theXYChartDataBuilder<X, Y>.- Returns:
- an instance of the
XYChartDataBuilder<X, Y>.
-
create
Accepts the constructor arguments ofData(X, Y)and returns an instance ofXYChartDataBuilder<X, Y>.- Returns:
- an instance of the
XYChartDataBuilder<X, Y>.
-
create
Accepts the constructor arguments ofData(X, Y, Object)and returns an instance ofXYChartDataBuilder<X, Y>.- Returns:
- an instance of the
XYChartDataBuilder<X, Y>.
-
build
-
apply
Applies a function to the Data instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
extraValue
A builder method that invokes thesetExtraValuemethod on the instance being constructed.- Returns:
- builder instance
-
node
A builder method that invokes thesetNodemethod on the instance being constructed.- Returns:
- builder instance
-
xValue
A builder method that invokes thesetXValuemethod on the instance being constructed.- Returns:
- builder instance
-
yValue
A builder method that invokes thesetYValuemethod on the instance being constructed.- Returns:
- builder instance
-
XValuePropertyApply
Applies a function to theXValuePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.XValueProperty().bind(anotherProperty)) // Use shorthand form .XValuePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
YValuePropertyApply
Applies a function to theYValuePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.YValueProperty().bind(anotherProperty)) // Use shorthand form .YValuePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
extraValuePropertyApply
Applies a function to theextraValuePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.extraValueProperty().bind(anotherProperty)) // Use shorthand form .extraValuePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
nodePropertyApply
Applies a function to thenodePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.nodeProperty().bind(anotherProperty)) // Use shorthand form .nodePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-