org.apache.cassandra.db

## Class AbstractBufferClusteringPrefix

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

All Implemented Interfaces:
  IMeasurableMemory, Clusterable, ClusteringPrefix

Direct Known Subclasses:
  BufferClustering, ClusteringBoundOrBoundary

    public abstract class AbstractBufferClusteringPrefix
    extends AbstractClusteringPrefix

### Nested Class Summary

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

`ClusteringPrefix.Deserializer, ClusteringPrefix.Kind, ClusteringPrefix.Serializer`

### Field Summary

Fields
`static java.nio.ByteBuffer[]` `EMPTY_VALUES_ARRAY`
`protected ClusteringPrefix.Kind` `kind`
`protected java.nio.ByteBuffer[]` `values`

### Fields inherited from interface org.apache.cassandra.db.ClusteringPrefix

`serializer`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`ClusteringPrefix` `clustering()`
`java.nio.ByteBuffer` `get(int i)` Retrieves the ith value of this prefix.
`java.nio.ByteBuffer[]` `getRawValues()` The values of this prefix as an array.
`ClusteringPrefix.Kind` `kind()`
`int` `size()` The number of values in this prefix.
`long` `unsharedHeapSize()`
`long` `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`

### Methods inherited from interface org.apache.cassandra.db.ClusteringPrefix

`toString`

### Field Detail

#### EMPTY_VALUES_ARRAY

    public static final java.nio.ByteBuffer[] EMPTY_VALUES_ARRAY

#### kind

    protected final ClusteringPrefix.Kind kind

#### values

    protected final java.nio.ByteBuffer[] values

### Constructor Detail

#### AbstractBufferClusteringPrefix

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

### Method Detail

#### kind

    public ClusteringPrefix.Kind kind()

#### clustering

    public ClusteringPrefix clustering()

Specified by:
  `clustering` in interface `Clusterable`
Overrides:
  `clustering` in class `AbstractClusteringPrefix`

#### size

    public int size()

Description copied from interface: `ClusteringPrefix`
The number of values in this prefix. There can't be more values that the this is a prefix of has of clustering columns.

Returns:
  the number of values in this prefix.

#### get

    public java.nio.ByteBuffer get(int i)

Description copied from interface: `ClusteringPrefix`
Retrieves the ith value of this prefix.

Parameters:
  `i` - the index of the value to retrieve. Must be such that `0 <= i < size()`.
Returns:
  the ith value of this prefix. Note that a value can be `null`.

#### getRawValues

    public java.nio.ByteBuffer[] getRawValues()

Description copied from interface: `ClusteringPrefix`
The values of this prefix as an array.

Please note that this may or may not require an array creation. So 1) you should *not* modify the returned array and 2) it's more efficient to use `ClusteringPrefix.size()` and `ClusteringPrefix.get(int)` unless you actually need an array.

Returns:
  the values for this prefix as an array.

#### unsharedHeapSize

    public long unsharedHeapSize()

Returns:
  the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.

#### unsharedHeapSizeExcludingData

    public long unsharedHeapSizeExcludingData()