Class AbstractOnHeapClusteringPrefix<V>

java.lang.Object
org.apache.cassandra.db.AbstractOnHeapClusteringPrefix<V>
All Implemented Interfaces:
IMeasurableMemory, Clusterable<V>, ClusteringPrefix<V>
Direct Known Subclasses:
AbstractArrayClusteringPrefix, AbstractBufferClusteringPrefix

public abstract class AbstractOnHeapClusteringPrefix<V> extends Object implements ClusteringPrefix<V>
  • Field Details

  • Constructor Details

    • AbstractOnHeapClusteringPrefix

      public AbstractOnHeapClusteringPrefix(ClusteringPrefix.Kind kind, V[] values)
  • Method Details

    • kind

      public ClusteringPrefix.Kind kind()
      Specified by:
      kind in interface ClusteringPrefix<V>
    • clustering

      public ClusteringPrefix<V> clustering()
      Specified by:
      clustering in interface Clusterable<V>
    • 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.
      Specified by:
      size in interface ClusteringPrefix<V>
      Returns:
      the number of values in this prefix.
    • get

      public V get(int i)
      Description copied from interface: ClusteringPrefix
      Retrieves the ith value of this prefix.
      Specified by:
      get in interface ClusteringPrefix<V>
      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 V[] 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.

      Specified by:
      getRawValues in interface ClusteringPrefix<V>
      Returns:
      the values for this prefix as an array.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object