org.apache.cassandra.db

## Class ClusteringBoundOrBoundary

- java.lang.Object
- - org.apache.cassandra.db.AbstractClusteringPrefix
  - - org.apache.cassandra.db.AbstractBufferClusteringPrefix
    - - org.apache.cassandra.db.ClusteringBoundOrBoundary

All Implemented Interfaces:
  IMeasurableMemory, Clusterable, ClusteringPrefix

Direct Known Subclasses:
  ClusteringBound, ClusteringBoundary

    public abstract class ClusteringBoundOrBoundary
    extends AbstractBufferClusteringPrefix

This class defines a threshold between ranges of clusterings. It can either be a start or end bound of a range, or the boundary between two different defined ranges.

The latter is used for range tombstones for 2 main reasons: 1) When merging multiple iterators having range tombstones (that are represented by their start and end markers), we need to know when a range is close on an iterator, if it is reopened right away. Otherwise, we cannot easily produce the markers on the merged iterators within risking to fail the sorting guarantees of an iterator. See this comment for more details: https://goo.gl/yyB5mR. 2) This saves some storage space.

### Nested Class Summary

Nested Classes
`static class` `ClusteringBoundOrBoundary.Serializer`

### Nested classes/interfaces inherited from interface org.apache.cassandra.db.ClusteringPrefix

`ClusteringPrefix.Deserializer, ClusteringPrefix.Kind`

### Field Summary

Fields
`static ClusteringBoundOrBoundary.Serializer` `serializer`

### Fields inherited from class org.apache.cassandra.db.AbstractBufferClusteringPrefix

`EMPTY_VALUES_ARRAY, kind, values`

### Constructor Summary

Constructors
`protected` `ClusteringBoundOrBoundary(ClusteringPrefix.Kind kind, java.nio.ByteBuffer[] values)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`ClusteringBoundOrBoundary` `copy(AbstractAllocator allocator)`
`static ClusteringBoundOrBoundary` `create(ClusteringPrefix.Kind kind, java.nio.ByteBuffer[] values)`
`static ClusteringBound` `exclusiveClose(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`static ClusteringBoundary` `exclusiveCloseInclusiveOpen(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`static ClusteringBound` `exclusiveOpen(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`static ClusteringBound` `inclusiveClose(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`static ClusteringBoundary` `inclusiveCloseExclusiveOpen(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`static ClusteringBound` `inclusiveOpen(boolean reversed, java.nio.ByteBuffer[] boundValues)`
`abstract ClusteringBoundOrBoundary` `invert()` Returns the inverse of the current bound.
`boolean` `isBoundary()`
`boolean` `isClose(boolean reversed)`
`boolean` `isOpen(boolean reversed)`
`java.lang.String` `toString(CFMetaData metadata)` Generates a proper string representation of the prefix.
`java.lang.String` `toString(ClusteringComparator comparator)`

### Methods inherited from class org.apache.cassandra.db.AbstractBufferClusteringPrefix

`clustering, get, getRawValues, kind, size, unsharedHeapSize, unsharedHeapSizeExcludingData`

### Methods inherited from class org.apache.cassandra.db.AbstractClusteringPrefix

`dataSize, digest, equals, hashCode`

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

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

### Field Detail

#### serializer

    public static final ClusteringBoundOrBoundary.Serializer serializer

### Constructor Detail

#### ClusteringBoundOrBoundary

    protected ClusteringBoundOrBoundary(ClusteringPrefix.Kind kind,
                                        java.nio.ByteBuffer[] values)

### Method Detail

#### create

    public static ClusteringBoundOrBoundary create(ClusteringPrefix.Kind kind,
                                                   java.nio.ByteBuffer[] values)

#### isBoundary

    public boolean isBoundary()

#### isOpen

    public boolean isOpen(boolean reversed)

#### isClose

    public boolean isClose(boolean reversed)

#### inclusiveOpen

    public static ClusteringBound inclusiveOpen(boolean reversed,
                                                java.nio.ByteBuffer[] boundValues)

#### exclusiveOpen

    public static ClusteringBound exclusiveOpen(boolean reversed,
                                                java.nio.ByteBuffer[] boundValues)

#### inclusiveClose

    public static ClusteringBound inclusiveClose(boolean reversed,
                                                 java.nio.ByteBuffer[] boundValues)

#### exclusiveClose

    public static ClusteringBound exclusiveClose(boolean reversed,
                                                 java.nio.ByteBuffer[] boundValues)

#### inclusiveCloseExclusiveOpen

    public static ClusteringBoundary inclusiveCloseExclusiveOpen(boolean reversed,
                                                                 java.nio.ByteBuffer[] boundValues)

#### exclusiveCloseInclusiveOpen

    public static ClusteringBoundary exclusiveCloseInclusiveOpen(boolean reversed,
                                                                 java.nio.ByteBuffer[] boundValues)

#### copy

    public ClusteringBoundOrBoundary copy(AbstractAllocator allocator)

#### toString

    public java.lang.String toString(CFMetaData metadata)

Description copied from interface: `ClusteringPrefix`
Generates a proper string representation of the prefix.

Parameters:
  `metadata` - the metadata for the table the clustering prefix is of.
Returns:
  a human-readable string representation fo this prefix.

#### toString

    public java.lang.String toString(ClusteringComparator comparator)

#### invert

    public abstract ClusteringBoundOrBoundary invert()

Returns the inverse of the current bound.

This invert both start into end (and vice-versa) and inclusive into exclusive (and vice-versa).

Returns:
  the invert of this bound. For instance, if this bound is an exlusive start, this return an inclusive end with the same values.