Package org.apache.cassandra.db
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 java.lang.Object implements ClusteringPrefix<V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.db.ClusteringPrefix
ClusteringPrefix.Deserializer, ClusteringPrefix.Kind, ClusteringPrefix.Serializer
-
-
Field Summary
Fields Modifier and Type Field Description protected ClusteringPrefix.Kind
kind
protected V[]
values
-
Fields inherited from interface org.apache.cassandra.db.ClusteringPrefix
serializer
-
-
Constructor Summary
Constructors Constructor Description AbstractOnHeapClusteringPrefix(ClusteringPrefix.Kind kind, V[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusteringPrefix<V>
clustering()
boolean
equals(java.lang.Object o)
V
get(int i)
Retrieves the ith value of this prefix.V[]
getRawValues()
The values of this prefix as an array.int
hashCode()
ClusteringPrefix.Kind
kind()
int
size()
The number of values in this prefix.-
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
accessor, asEndBound, asStartBound, bufferAt, clusteringString, dataSize, digest, getBufferArray, isBottom, isEmpty, isTop, retainable, serializeAsPartitionKey, stringAt, toString, validate, validate
-
Methods inherited from interface org.apache.cassandra.cache.IMeasurableMemory
unsharedHeapSize
-
-
-
-
Field Detail
-
kind
protected final ClusteringPrefix.Kind kind
-
values
protected final V[] values
-
-
Constructor Detail
-
AbstractOnHeapClusteringPrefix
public AbstractOnHeapClusteringPrefix(ClusteringPrefix.Kind kind, V[] values)
-
-
Method Detail
-
kind
public ClusteringPrefix.Kind kind()
- Specified by:
kind
in interfaceClusteringPrefix<V>
-
clustering
public ClusteringPrefix<V> clustering()
- Specified by:
clustering
in interfaceClusterable<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 interfaceClusteringPrefix<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 interfaceClusteringPrefix<V>
- Parameters:
i
- the index of the value to retrieve. Must be such that0 <= 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()
andClusteringPrefix.get(int)
unless you actually need an array.- Specified by:
getRawValues
in interfaceClusteringPrefix<V>
- Returns:
- the values for this prefix as an array.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-