# Interface BuilderFactory

All Known Implementing Classes:
  `DoubleBuilderFactory, FloatBuilderFactory, IntAparapiBuilderFactory, IntBuilderFactory, LongAparapiBuilderFactory, LongBuilderFactory`

public interface BuilderFactory
A `BuilderFactory` object contains factory methods for building the various parts of an apfloat using the Builder pattern. There is no separate "director" object in the apfloat SPI; it is suggested that the `ApfloatImpl` implementation itself acts as the director, calling the different builders directly.

Version:
  1.9.0
Author:
  Mikko Tommila

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `gc()`
  Do garbage collection and related things such as empty any reference queues.
  `<T> AdditionBuilder<T>`
  `getAdditionBuilder(Class<T> elementType)`
  Returns an `AdditionBuilder` object.
  `ApfloatBuilder`
  `getApfloatBuilder()`
  Returns an `ApfloatBuilder` object.
  `<T> CarryCRTBuilder<T>`
  `getCarryCRTBuilder(Class<T> elementArrayType)`
  Returns a `CarryCRTBuilder` object.
  `ConvolutionBuilder`
  `getConvolutionBuilder()`
  Returns a `ConvolutionBuilder` object.
  `DataStorageBuilder`
  `getDataStorageBuilder()`
  Returns a `DataStorageBuilder` object.
  `Class<?>`
  `getElementArrayType()`
  Returns the element array type of the data objects created.
  `int`
  `getElementSize()`
  Returns the element size of the data objects created, in bytes.
  `Class<?>`
  `getElementType()`
  Returns the element type of the data objects created.
  `ExecutionBuilder`
  `getExecutionBuilder()`
  Returns an `ExecutionBuilder` object.
  `MatrixBuilder`
  `getMatrixBuilder()`
  Returns a `MatrixBuilder` object.
  `NTTBuilder`
  `getNTTBuilder()`
  Returns an `NTTBuilder` object.
  `void`
  `shutdown()`
  Shuts down the builder factory.

- ## Method Details

  - ### getApfloatBuilder

    ApfloatBuilder getApfloatBuilder()
    Returns an `ApfloatBuilder` object.
    Returns:
      An `ApfloatBuilder` object.

  - ### getDataStorageBuilder

    DataStorageBuilder getDataStorageBuilder()
    Returns a `DataStorageBuilder` object.
    Returns:
      A `DataStorageBuilder` object.

  - ### getAdditionBuilder

    <T> AdditionBuilder<T> getAdditionBuilder(Class<T> elementType) throws IllegalArgumentException
    Returns an `AdditionBuilder` object.
    Type Parameters:
      `T` - The element type of the additions.
    Parameters:
      `elementType` - The element type of the additions.
    Returns:
      An `AdditionBuilder` object.
    Throws:
      `IllegalArgumentException` - In case of unsupported element type.
    Since:
      1.7.0

  - ### getConvolutionBuilder

    ConvolutionBuilder getConvolutionBuilder()
    Returns a `ConvolutionBuilder` object.
    Returns:
      A `ConvolutionBuilder` object.

  - ### getNTTBuilder

    NTTBuilder getNTTBuilder()
    Returns an `NTTBuilder` object.
    Returns:
      An `NTTBuilder` object.

  - ### getMatrixBuilder

    MatrixBuilder getMatrixBuilder()
    Returns a `MatrixBuilder` object.
    Returns:
      A `MatrixBuilder` object.
    Since:
      1.7.0

  - ### getCarryCRTBuilder

    <T> CarryCRTBuilder<T> getCarryCRTBuilder(Class<T> elementArrayType) throws IllegalArgumentException
    Returns a `CarryCRTBuilder` object.
    Type Parameters:
      `T` - The element array type of the carry-CRT.
    Parameters:
      `elementArrayType` - The element array type of the carry-CRT.
    Returns:
      A `CarryCRTBuilder` object.
    Throws:
      `IllegalArgumentException` - In case of unsupported element array type.
    Since:
      1.7.0

  - ### getExecutionBuilder

    ExecutionBuilder getExecutionBuilder()
    Returns an `ExecutionBuilder` object.
    Returns:
      An `ExecutionBuilder` object.
    Since:
      1.9.0

  - ### getElementType

    Class<?> getElementType()
    Returns the element type of the data objects created.
    Returns:
      The element type of the data objects created.
    Since:
      1.7.0

  - ### getElementArrayType

    Class<?> getElementArrayType()
    Returns the element array type of the data objects created.
    Returns:
      The element array type of the data objects created.
    Since:
      1.7.0

  - ### getElementSize

    int getElementSize()
    Returns the element size of the data objects created, in bytes.
    Returns:
      The element size of the data objects created, in bytes.
    Since:
      1.7.0

  - ### shutdown

    void shutdown() throws ApfloatRuntimeException
    Shuts down the builder factory. Clean-up tasks can be executed by this method. This method is invoked by the `ApfloatContext` when cleanupAtExit is enabled.
    Throws:
      `ApfloatRuntimeException`
    Since:
      1.6.2

  - ### gc

    void gc() throws ApfloatRuntimeException
    Do garbage collection and related things such as empty any reference queues.
    Throws:
      `ApfloatRuntimeException`
    Since:
      1.6.2