TokenRestriction.Slice (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cql3.restrictions

## Class TokenRestriction.Slice

- java.lang.Object
- - org.apache.cassandra.cql3.restrictions.TokenRestriction
  - - org.apache.cassandra.cql3.restrictions.TokenRestriction.Slice

- All Implemented Interfaces:
    Restriction
  Enclosing class:
    TokenRestriction

      public static class TokenRestriction.Slice
      extends TokenRestriction

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.cql3.restrictions.TokenRestriction

      `TokenRestriction.EQ, TokenRestriction.Slice`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CType` | `ctype` The composite type.

    - ### Fields inherited from class org.apache.cassandra.cql3.restrictions.TokenRestriction

      `columnDefs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Slice(CType ctype, java.util.List<ColumnDefinition> columnDefs, Bound bound, boolean inclusive, Term term)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CompositesBuilder` | `appendBoundTo(CFMetaData cfm, CompositesBuilder builder, Bound bound, QueryOptions options)` Appends the values of the `Restriction` for the specified bound to the specified builder.
    `java.util.List<java.nio.ByteBuffer>` | `bounds(CFMetaData cfm, Bound b, QueryOptions options)`
    `protected org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictions` | `doMergeWith(TokenRestriction otherRestriction)` Merges this restriction with the specified `TokenRestriction`.
    `java.lang.Iterable<Function>` | `getFunctions()` Return an Iterable over all of the functions (both native and user-defined) used by any component of the restriction
    `boolean` | `hasBound(Bound b)` Checks if the specified bound is set or not.
    `boolean` | `isContains()`
    `boolean` | `isEmpty()` Checks if this `PrimaryKeyRestrictionSet` is empty or not.
    `boolean` | `isEQ()`
    `boolean` | `isIN()`
    `boolean` | `isInclusive(Bound b)` Checks if the specified bound is inclusive or not.
    `boolean` | `isMultiColumn()`
    `boolean` | `isNotReturningAnyRows(CFMetaData cfm, QueryOptions options)` Checks if this restriction will prevent the query to return any rows.
    `boolean` | `isSlice()`
    `protected static Bound` | `reverseBoundIfNeeded(ColumnDefinition columnDefinition, Bound bound)` Reverses the specified bound if the column type is a reversed one.
    `int` | `size()` Returns the number of columns that have a restriction.
    `java.lang.String` | `toString()`
    `protected static java.nio.ByteBuffer` | `validateIndexedValue(ColumnSpecification columnSpec, java.nio.ByteBuffer value)`
    `java.util.List<java.nio.ByteBuffer>` | `values(CFMetaData cfm, QueryOptions options)`

    - ### Methods inherited from class org.apache.cassandra.cql3.restrictions.TokenRestriction

      `addIndexExpressionTo, appendTo, boundsAsComposites, getColumnDefs, getColumnNamesAsString, getFirstColumn, getLastColumn, hasSupportingIndex, isOnToken, mergeWith, valuesAsComposites`

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

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

    - ### Methods inherited from interface org.apache.cassandra.cql3.restrictions.Restriction

      `appendBoundTo, isContains, isEQ, isIN, isMultiColumn, isNotReturningAnyRows`

- - ### Field Detail

    - #### ctype

          protected final CType ctype

      The composite type.

  - ### Constructor Detail

    - #### Slice

          public Slice(CType ctype,
                       java.util.List<ColumnDefinition> columnDefs,
                       Bound bound,
                       boolean inclusive,
                       Term term)

  - ### Method Detail

    - #### isSlice

          public boolean isSlice()

      Specified by:
        `isSlice` in interface `Restriction`

    - #### values

          public java.util.List<java.nio.ByteBuffer> values(CFMetaData cfm,
                                                            QueryOptions options)
                                                     throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### hasBound

          public boolean hasBound(Bound b)

      Description copied from interface: `Restriction`
      Checks if the specified bound is set or not.
      Specified by:
        `hasBound` in interface `Restriction`
      Parameters:
        `b` - the bound type
      Returns:
        `true` if the specified bound is set, `false` otherwise

    - #### bounds

          public java.util.List<java.nio.ByteBuffer> bounds(CFMetaData cfm,
                                                            Bound b,
                                                            QueryOptions options)
                                                     throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### getFunctions

          public java.lang.Iterable<Function> getFunctions()

      Description copied from interface: `Restriction`
      Return an Iterable over all of the functions (both native and user-defined) used by any component of the restriction
      Returns:
        functions all functions found (may contain duplicates)

    - #### isInclusive

          public boolean isInclusive(Bound b)

      Description copied from interface: `Restriction`
      Checks if the specified bound is inclusive or not.
      Specified by:
        `isInclusive` in interface `Restriction`
      Parameters:
        `b` - the bound type
      Returns:
        `true` if the specified bound is inclusive, `false` otherwise

    - #### doMergeWith

          protected org.apache.cassandra.cql3.restrictions.PrimaryKeyRestrictions doMergeWith(TokenRestriction otherRestriction)
                                                                                       throws InvalidRequestException

      Description copied from class: `TokenRestriction`
      Merges this restriction with the specified `TokenRestriction`.
      Specified by:
        `doMergeWith` in class `TokenRestriction`
      Parameters:
        `otherRestriction` - the `TokenRestriction` to merge with.
      Throws:
        `InvalidRequestException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### isEmpty

          public final boolean isEmpty()

      Checks if this `PrimaryKeyRestrictionSet` is empty or not.
      Returns:
        `true` if this `PrimaryKeyRestrictionSet` is empty, `false` otherwise.

    - #### size

          public final int size()

      Returns the number of columns that have a restriction.
      Returns:
        the number of columns that have a restriction.

    - #### isMultiColumn

          public boolean isMultiColumn()

      Specified by:
        `isMultiColumn` in interface `Restriction`

    - #### isEQ

          public boolean isEQ()

      Specified by:
        `isEQ` in interface `Restriction`

    - #### isIN

          public boolean isIN()

      Specified by:
        `isIN` in interface `Restriction`

    - #### isContains

          public boolean isContains()

      Specified by:
        `isContains` in interface `Restriction`

    - #### appendBoundTo

          public CompositesBuilder appendBoundTo(CFMetaData cfm,
                                                 CompositesBuilder builder,
                                                 Bound bound,
                                                 QueryOptions options)

      Description copied from interface: `Restriction`
      Appends the values of the `Restriction` for the specified bound to the specified builder.
      Specified by:
        `appendBoundTo` in interface `Restriction`
      Parameters:
        `cfm` - the table metadata
        `builder` - the `CompositesBuilder` to append to.
        `bound` - the bound
        `options` - the query options
      Returns:
        the `CompositesBuilder`

    - #### isNotReturningAnyRows

          public boolean isNotReturningAnyRows(CFMetaData cfm,
                                               QueryOptions options)

      Description copied from interface: `Restriction`
      Checks if this restriction will prevent the query to return any rows.
      Specified by:
        `isNotReturningAnyRows` in interface `Restriction`
      Parameters:
        `cfm` - the table metadata
        `options` - the query options
      Returns:
        `true` if this restriction will prevent the query to return any rows, otherwise

    - #### validateIndexedValue

          protected static java.nio.ByteBuffer validateIndexedValue(ColumnSpecification columnSpec,
                                                                    java.nio.ByteBuffer value)
                                                             throws InvalidRequestException

      Throws:
        `InvalidRequestException`

    - #### reverseBoundIfNeeded

          protected static Bound reverseBoundIfNeeded(ColumnDefinition columnDefinition,
                                                      Bound bound)

      Reverses the specified bound if the column type is a reversed one.
      Parameters:
        `columnDefinition` - the column definition
        `bound` - the bound
      Returns:
        the bound reversed if the column type was a reversed one or the original bound

Copyright © 2018 The Apache Software Foundation