Class FloatMapBuilder

java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.FloatMapBuilder

public class FloatMapBuilder extends Object
The FloatMapBuilder class constructs instances of the FloatMap 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 FloatMap constructor and returns an instance of the FloatMapBuilder.

You can use method chaining to call the builder methods for configuring the FloatMap. Finally, invoke the build method to generate an instance of the FloatMap 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 Details

    • create

      public static FloatMapBuilder create()
      Returns an instance of the FloatMapBuilder.
      Returns:
      an instance of the FloatMapBuilder.
    • create

      public static FloatMapBuilder create(int width, int height)
      Accepts the constructor arguments of FloatMap(int, int) and returns an instance of FloatMapBuilder.
      Returns:
      an instance of the FloatMapBuilder.
    • build

      public FloatMap build()
      Builds and returns an instance of the FloatMap class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the FloatMap class
    • apply

      public FloatMapBuilder apply(Consumer<FloatMap> func)
      Applies a function to the FloatMap instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • height

      public FloatMapBuilder height(int value)
      A builder method that invokes the setHeight method on the instance being constructed.
      Returns:
      builder instance
    • sample

      public FloatMapBuilder sample(int x, int y, int band, float s)
      A builder method that invokes the setSample method on the instance being constructed.
      Returns:
      builder instance
    • samples

      public FloatMapBuilder samples(int x, int y, float s0)
      A builder method that invokes the setSamples method on the instance being constructed.
      Returns:
      builder instance
    • samples

      public FloatMapBuilder samples(int x, int y, float s0, float s1)
      A builder method that invokes the setSamples method on the instance being constructed.
      Returns:
      builder instance
    • samples

      public FloatMapBuilder samples(int x, int y, float s0, float s1, float s2)
      A builder method that invokes the setSamples method on the instance being constructed.
      Returns:
      builder instance
    • samples

      public FloatMapBuilder samples(int x, int y, float s0, float s1, float s2, float s3)
      A builder method that invokes the setSamples method on the instance being constructed.
      Returns:
      builder instance
    • width

      public FloatMapBuilder width(int value)
      A builder method that invokes the setWidth method on the instance being constructed.
      Returns:
      builder instance
    • heightPropertyApply

      public FloatMapBuilder heightPropertyApply(Consumer<IntegerProperty> op)
      Applies a function to the heightProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.heightProperty().bind(anotherProperty))
      
      // Use shorthand form
      .heightPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • widthPropertyApply

      public FloatMapBuilder widthPropertyApply(Consumer<IntegerProperty> op)
      Applies a function to the widthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.widthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .widthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance