MultiCBuilder (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.db

## Class MultiCBuilder

- java.lang.Object
- - org.apache.cassandra.db.MultiCBuilder

-     public abstract class MultiCBuilder
      extends java.lang.Object

  Builder that allow to build multiple Clustering/ClusteringBound at the same time.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `built` `true` if the clusterings have been build, `false` otherwise.
    `protected ClusteringComparator` | `comparator` The table comparator.
    `protected boolean` | `containsNull` `true` if the clusterings contains some `null` elements.
    `protected boolean` | `containsUnset` `true` if the composites contains some `unset` elements.
    `protected boolean` | `hasMissingElements` `true` if some empty collection have been added.
    `protected int` | `size` The number of clustering elements that have been added.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MultiCBuilder(ClusteringComparator comparator)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract MultiCBuilder` | `addAllElementsToAll(java.util.List<java.util.List<java.nio.ByteBuffer>> values)` Adds individually each of the specified list of elements to the end of all of the existing composites.
    `abstract MultiCBuilder` | `addEachElementToAll(java.util.List<java.nio.ByteBuffer> values)` Adds individually each of the specified elements to the end of all of the existing clusterings.
    `abstract MultiCBuilder` | `addElementToAll(java.nio.ByteBuffer value)` Adds the specified element to all the clusterings.
    `abstract java.util.NavigableSet<Clustering>` | `build()` Builds the `clusterings`.
    `abstract java.util.NavigableSet<ClusteringBound>` | `buildBound(boolean isStart, boolean isInclusive)` Builds the `ClusteringBound`s
    `abstract java.util.NavigableSet<ClusteringBound>` | `buildBoundForSlice(boolean isStart, boolean isInclusive, boolean isOtherBoundInclusive, java.util.List<ColumnDefinition> columnDefs)` Builds the `ClusteringBound`s for slice restrictions.
    `protected void` | `checkUpdateable()`
    `boolean` | `containsNull()` Checks if the clusterings contains null elements.
    `boolean` | `containsUnset()` Checks if the clusterings contains unset elements.
    `static MultiCBuilder` | `create(ClusteringComparator comparator, boolean forMultipleValues)` Creates a new empty `MultiCBuilder`.
    `boolean` | `hasMissingElements()` Checks if some empty list of values have been added
    `boolean` | `hasRemaining()` Checks if some elements can still be added to the clusterings.
    `int` | `remainingCount()` Returns the number of elements that can be added to the clusterings.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### comparator

          protected final ClusteringComparator comparator

      The table comparator.

    - #### size

          protected int size

      The number of clustering elements that have been added.

    - #### built

          protected boolean built

      `true` if the clusterings have been build, `false` otherwise.

    - #### containsNull

          protected boolean containsNull

      `true` if the clusterings contains some `null` elements.

    - #### containsUnset

          protected boolean containsUnset

      `true` if the composites contains some `unset` elements.

    - #### hasMissingElements

          protected boolean hasMissingElements

      `true` if some empty collection have been added.

  - ### Constructor Detail

    - #### MultiCBuilder

          protected MultiCBuilder(ClusteringComparator comparator)

  - ### Method Detail

    - #### create

          public static MultiCBuilder create(ClusteringComparator comparator,
                                             boolean forMultipleValues)

      Creates a new empty `MultiCBuilder`.

    - #### addElementToAll

          public abstract MultiCBuilder addElementToAll(java.nio.ByteBuffer value)

      Adds the specified element to all the clusterings.

      If this builder contains 2 clustering: A-B and A-C a call to this method to add D will result in the clusterings: A-B-D and A-C-D.

      Parameters:
        `value` - the value of the next element
      Returns:
        this `MulitCBuilder`

    - #### addEachElementToAll

          public abstract MultiCBuilder addEachElementToAll(java.util.List<java.nio.ByteBuffer> values)

      Adds individually each of the specified elements to the end of all of the existing clusterings.

      If this builder contains 2 clusterings: A-B and A-C a call to this method to add D and E will result in the 4 clusterings: A-B-D, A-B-E, A-C-D and A-C-E.

      Parameters:
        `values` - the elements to add
      Returns:
        this `CompositeBuilder`

    - #### addAllElementsToAll

          public abstract MultiCBuilder addAllElementsToAll(java.util.List<java.util.List<java.nio.ByteBuffer>> values)

      Adds individually each of the specified list of elements to the end of all of the existing composites.

      If this builder contains 2 composites: A-B and A-C a call to this method to add [[D, E], [F, G]] will result in the 4 composites: A-B-D-E, A-B-F-G, A-C-D-E and A-C-F-G.

      Parameters:
        `values` - the elements to add
      Returns:
        this `CompositeBuilder`

    - #### checkUpdateable

          protected void checkUpdateable()

    - #### remainingCount

          public int remainingCount()

      Returns the number of elements that can be added to the clusterings.
      Returns:
        the number of elements that can be added to the clusterings.

    - #### containsNull

          public boolean containsNull()

      Checks if the clusterings contains null elements.
      Returns:
        `true` if the clusterings contains `null` elements, `false` otherwise.

    - #### containsUnset

          public boolean containsUnset()

      Checks if the clusterings contains unset elements.
      Returns:
        `true` if the clusterings contains `unset` elements, `false` otherwise.

    - #### hasMissingElements

          public boolean hasMissingElements()

      Checks if some empty list of values have been added
      Returns:
        `true` if the clusterings have some missing elements, `false` otherwise.

    - #### build

          public abstract java.util.NavigableSet<Clustering> build()

      Builds the `clusterings`.
      Returns:
        the clusterings

    - #### buildBoundForSlice

          public abstract java.util.NavigableSet<ClusteringBound> buildBoundForSlice(boolean isStart,
                                                                                     boolean isInclusive,
                                                                                     boolean isOtherBoundInclusive,
                                                                                     java.util.List<ColumnDefinition> columnDefs)

      Builds the `ClusteringBound`s for slice restrictions.
      Parameters:
        `isStart` - specify if the bound is a start one
        `isInclusive` - specify if the bound is inclusive or not
        `isOtherBoundInclusive` - specify if the other bound is inclusive or not
        `columnDefs` - the columns of the slice restriction
      Returns:
        the `ClusteringBound`s

    - #### buildBound

          public abstract java.util.NavigableSet<ClusteringBound> buildBound(boolean isStart,
                                                                             boolean isInclusive)

      Builds the `ClusteringBound`s
      Parameters:
        `isStart` - specify if the bound is a start one
        `isInclusive` - specify if the bound is inclusive or not
      Returns:
        the `ClusteringBound`s

    - #### hasRemaining

          public boolean hasRemaining()

      Checks if some elements can still be added to the clusterings.
      Returns:
        `true` if it is possible to add more elements to the clusterings, `false` otherwise.

Copyright © 2018 The Apache Software Foundation