## org.apache.cassandra.db
Interface ISortedColumns

All Superinterfaces:
  IIterableColumns, java.lang.Iterable<IColumn>

All Known Implementing Classes:
  ArrayBackedSortedColumns, ThreadSafeSortedColumns, TreeMapBackedSortedColumns

    public interface ISortedColumns

extends IIterableColumns

A sorted map of columns. This represents the backing map of a colum family. Whether the implementation is thread safe or not is left to the implementing classes.

Nested Class Summary
`static interface` `ISortedColumns.Factory`

Method Summary
`void` `addAll(ISortedColumns cm, Allocator allocator)` Adds all the columns of a given column map to this column map.
`void` `addColumn(IColumn column, Allocator allocator)` Adds a column to this column map.
`void` `clear()` Clear this column map, removing all columns.
`ISortedColumns` `cloneMe()` Shallow cloning of the column map.
`IColumn` `getColumn(java.nio.ByteBuffer name)` Get a column given its name, returning null if the column is not present.
`java.util.SortedSet<java.nio.ByteBuffer>` `getColumnNames()` Returns a set with the names of columns in this column map.
`ISortedColumns.Factory` `getFactory()` Returns the factory used for this ISortedColumns implementation.
`java.util.Collection<IColumn>` `getReverseSortedColumns()` Returns the columns of this column map as a collection.
`java.util.Collection<IColumn>` `getSortedColumns()` Returns the columns of this column map as a collection.
`boolean` `isEmpty()` Returns true if this map is empty, false otherwise.
`boolean` `isInsertReversed()` Returns if this map only support inserts in reverse order.
`void` `removeColumn(java.nio.ByteBuffer name)` Remove if present a column by name.
`boolean` `replace(IColumn oldColumn, IColumn newColumn)` Replace oldColumn if present by newColumn.
`java.util.Iterator<IColumn>` `reverseIterator()` Returns an iterator that iterates over the columns of this map in reverse order.
`int` `size()` Returns the number of columns in this map.

Methods inherited from interface org.apache.cassandra.io.util.IIterableColumns
`getComparator, getEstimatedColumnCount`

Methods inherited from interface java.lang.Iterable
`iterator`

Method Detail

### cloneMe

    ISortedColumns cloneMe()

  Shallow cloning of the column map.

### getFactory

    ISortedColumns.Factory getFactory()

  Returns the factory used for this ISortedColumns implementation.

### addColumn

    void addColumn(IColumn column,
                   Allocator allocator)

  Adds a column to this column map. If a column with the same name is already present in the map, it will be replaced by the newly added column.

### addAll

    void addAll(ISortedColumns cm,
                Allocator allocator)

  Adds all the columns of a given column map to this column map. This is equivalent to: `for (Column c : cm) add(c);` but is potentially faster.

### replace

    boolean replace(IColumn oldColumn,
                    IColumn newColumn)

  Replace oldColumn if present by newColumn. Returns true if oldColumn was present and thus replaced. oldColumn and newColumn should have the same name.

### removeColumn

    void removeColumn(java.nio.ByteBuffer name)

  Remove if present a column by name.

### clear

    void clear()

  Clear this column map, removing all columns.

### getColumn

    IColumn getColumn(java.nio.ByteBuffer name)

  Get a column given its name, returning null if the column is not present.

### getColumnNames

    java.util.SortedSet<java.nio.ByteBuffer> getColumnNames()

  Returns a set with the names of columns in this column map. The resulting set is sorted and the order is the one of the columns in this column map.

### getSortedColumns

    java.util.Collection<IColumn> getSortedColumns()

  Returns the columns of this column map as a collection. The columns in the returned collection should be sorted as the columns in this map.

### getReverseSortedColumns

    java.util.Collection<IColumn> getReverseSortedColumns()

  Returns the columns of this column map as a collection. The columns in the returned collection should be sorted in reverse order of the columns in this map.

### size

    int size()

  Returns the number of columns in this map.

### isEmpty

    boolean isEmpty()

  Returns true if this map is empty, false otherwise.

### reverseIterator

    java.util.Iterator<IColumn> reverseIterator()

  Returns an iterator that iterates over the columns of this map in reverse order.

### isInsertReversed

    boolean isInsertReversed()

  Returns if this map only support inserts in reverse order.

Copyright © 2012 The Apache Software Foundation