org.apache.cassandra.db

## Class Column

- java.lang.Object
- - org.apache.cassandra.db.Column

All Implemented Interfaces:
  OnDiskAtom

Direct Known Subclasses:
  CounterColumn, CounterUpdateColumn, DeletedColumn, ExpiringColumn

    public class Column
    extends java.lang.Object
    implements OnDiskAtom

Column is immutable, which prevents all kinds of confusion in a multithreaded environment.

### Nested Class Summary

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

`OnDiskAtom.Serializer`

### Field Summary

Fields
`static int` `MAX_NAME_LENGTH`
`protected java.nio.ByteBuffer` `name`
`static ColumnSerializer` `serializer`
`protected long` `timestamp`
`protected java.nio.ByteBuffer` `value`

### Constructor Summary

Constructors
Constructor and Description
`Column(java.nio.ByteBuffer name, java.nio.ByteBuffer value)`
`Column(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp)`

### Method Summary

Methods
`static Column` `create(boolean value, long timestamp, java.lang.String... names)`
`static Column` `create(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp, int ttl, CFMetaData metadata)`
`static Column` `create(java.nio.ByteBuffer value, long timestamp, java.lang.String... names)`
`static Column` `create(double value, long timestamp, java.lang.String... names)`
`static Column` `create(java.net.InetAddress value, long timestamp, java.lang.String... names)`
`static Column` `create(int value, long timestamp, java.lang.String... names)`
`static Column` `create(java.lang.String value, long timestamp, java.lang.String... names)`
`int` `dataSize()`
`Column` `diff(Column column)`
`boolean` `equals(java.lang.Object o)`
`int` `getLocalDeletionTime()`
`long` `getMarkedForDeleteAt()`
`java.lang.String` `getString(AbstractType<?> comparator)`
`int` `hashCode()`
`boolean` `hasIrrelevantData(int gcBefore)`
`boolean` `isLive(long now)`
`boolean` `isMarkedForDelete(long now)`
`Column` `localCopy(ColumnFamilyStore cfs)`
`Column` `localCopy(ColumnFamilyStore cfs, Allocator allocator)`
`long` `maxTimestamp()`
`long` `minTimestamp()` For a standard column, this is the same as timestamp().
`java.nio.ByteBuffer` `name()`
`static java.util.Iterator<OnDiskAtom>` `onDiskIterator(java.io.DataInput in, int count, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version)` For 2.0-formatted sstables (where column count is not stored), @param count should be Integer.MAX_VALUE, and we will look for the end-of-row column name marker instead of relying on that.
`static OnDiskAtom.Serializer` `onDiskSerializer()`
`Column` `reconcile(Column column)`
`Column` `reconcile(Column column, Allocator allocator)`
`int` `serializationFlags()`
`int` `serializedSize(TypeSizes typeSizes)`
`long` `serializedSizeForSSTable()`
`long` `timestamp()`
`void` `updateDigest(java.security.MessageDigest digest)`
`void` `validateFields(CFMetaData metadata)`
`protected void` `validateName(CFMetaData metadata)`
`java.nio.ByteBuffer` `value()`
`Column` `withUpdatedName(java.nio.ByteBuffer newName)`
`Column` `withUpdatedTimestamp(long newTimestamp)`

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

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

### Field Detail

#### MAX_NAME_LENGTH

    public static final int MAX_NAME_LENGTH

See Also:
  Constant Field Values

#### serializer

    public static final ColumnSerializer serializer

#### name

    protected final java.nio.ByteBuffer name

#### value

    protected final java.nio.ByteBuffer value

#### timestamp

    protected final long timestamp

### Constructor Detail

#### Column

    public Column(java.nio.ByteBuffer name,
          java.nio.ByteBuffer value)

#### Column

    public Column(java.nio.ByteBuffer name,
          java.nio.ByteBuffer value,
          long timestamp)

### Method Detail

#### onDiskSerializer

    public static OnDiskAtom.Serializer onDiskSerializer()

#### onDiskIterator

    public static java.util.Iterator<OnDiskAtom> onDiskIterator(java.io.DataInput in,
                                                int count,
                                                ColumnSerializer.Flag flag,
                                                int expireBefore,
                                                Descriptor.Version version)

For 2.0-formatted sstables (where column count is not stored), @param count should be Integer.MAX_VALUE, and we will look for the end-of-row column name marker instead of relying on that.

#### withUpdatedName

    public Column withUpdatedName(java.nio.ByteBuffer newName)

#### withUpdatedTimestamp

    public Column withUpdatedTimestamp(long newTimestamp)

#### name

    public java.nio.ByteBuffer name()

Specified by:
  `name` in interface `OnDiskAtom`

#### value

    public java.nio.ByteBuffer value()

#### timestamp

    public long timestamp()

#### minTimestamp

    public long minTimestamp()

Description copied from interface: `OnDiskAtom`
For a standard column, this is the same as timestamp(). For a super column, this is the min/max column timestamp of the sub columns.

Specified by:
  `minTimestamp` in interface `OnDiskAtom`

#### maxTimestamp

    public long maxTimestamp()

Specified by:
  `maxTimestamp` in interface `OnDiskAtom`

#### isMarkedForDelete

    public boolean isMarkedForDelete(long now)

#### isLive

    public boolean isLive(long now)

#### getMarkedForDeleteAt

    public long getMarkedForDeleteAt()

#### dataSize

    public int dataSize()

#### serializedSize

    public int serializedSize(TypeSizes typeSizes)

Specified by:
  `serializedSize` in interface `OnDiskAtom`

#### serializedSizeForSSTable

    public long serializedSizeForSSTable()

Specified by:
  `serializedSizeForSSTable` in interface `OnDiskAtom`

#### serializationFlags

    public int serializationFlags()

#### diff

    public Column diff(Column column)

#### updateDigest

    public void updateDigest(java.security.MessageDigest digest)

Specified by:
  `updateDigest` in interface `OnDiskAtom`

#### getLocalDeletionTime

    public int getLocalDeletionTime()

Specified by:
  `getLocalDeletionTime` in interface `OnDiskAtom`

#### reconcile

    public Column reconcile(Column column)

#### reconcile

    public Column reconcile(Column column,
                   Allocator allocator)

#### equals

    public boolean equals(java.lang.Object o)

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

#### hashCode

    public int hashCode()

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

#### localCopy

    public Column localCopy(ColumnFamilyStore cfs)

#### localCopy

    public Column localCopy(ColumnFamilyStore cfs,
                   Allocator allocator)

#### getString

    public java.lang.String getString(AbstractType<?> comparator)

#### validateName

    protected void validateName(CFMetaData metadata)
                         throws MarshalException

Throws:
  `MarshalException`

#### validateFields

    public void validateFields(CFMetaData metadata)
                        throws MarshalException

Specified by:
  `validateFields` in interface `OnDiskAtom`
Throws:
  `MarshalException`

#### hasIrrelevantData

    public boolean hasIrrelevantData(int gcBefore)

#### create

    public static Column create(java.nio.ByteBuffer name,
                java.nio.ByteBuffer value,
                long timestamp,
                int ttl,
                CFMetaData metadata)

#### create

    public static Column create(java.lang.String value,
                long timestamp,
                java.lang.String... names)

#### create

    public static Column create(int value,
                long timestamp,
                java.lang.String... names)

#### create

    public static Column create(boolean value,
                long timestamp,
                java.lang.String... names)

#### create

    public static Column create(double value,
                long timestamp,
                java.lang.String... names)

#### create

    public static Column create(java.nio.ByteBuffer value,
                long timestamp,
                java.lang.String... names)

#### create

    public static Column create(java.net.InetAddress value,
                long timestamp,
                java.lang.String... names)