com.netflix.astyanax.thrift.model
Class ThriftColumnOrSuperColumnListImpl<C>

java.lang.Object
  extended by com.netflix.astyanax.model.AbstractColumnList<C>
      extended by com.netflix.astyanax.thrift.model.ThriftColumnOrSuperColumnListImpl<C>
Type Parameters:
C -
All Implemented Interfaces:
ColumnList<C>, Iterable<Column<C>>

public class ThriftColumnOrSuperColumnListImpl<C>
extends AbstractColumnList<C>

List of columns that can be either a list of super columns or standard columns.

Author:
elandau

Constructor Summary
ThriftColumnOrSuperColumnListImpl(List<org.apache.cassandra.thrift.ColumnOrSuperColumn> columns, Serializer<C> colSer)
           
 
Method Summary
 Column<C> getColumnByIndex(int idx)
          Queries column by index
 Column<C> getColumnByName(C columnName)
          Queries column by name
<C2> Column<C2>
getSuperColumn(C columnName, Serializer<C2> colSer)
          Return the super column with the specified name
<C2> Column<C2>
getSuperColumn(int idx, Serializer<C2> colSer)
          Get super column by index
 boolean isEmpty()
          Indicates if the list of columns is empty
 boolean isSuperColumn()
          Returns true if the columns are super columns with subcolumns.
 Iterator<Column<C>> iterator()
           
 int size()
          returns the number of columns in the row
 
Methods inherited from class com.netflix.astyanax.model.AbstractColumnList
getBooleanValue, getByteArrayValue, getByteBufferValue, getDateValue, getDoubleValue, getIntegerValue, getLongValue, getStringValue, getUUIDValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThriftColumnOrSuperColumnListImpl

public ThriftColumnOrSuperColumnListImpl(List<org.apache.cassandra.thrift.ColumnOrSuperColumn> columns,
                                         Serializer<C> colSer)
Method Detail

iterator

public Iterator<Column<C>> iterator()

getColumnByName

public Column<C> getColumnByName(C columnName)
Description copied from interface: ColumnList
Queries column by name

Returns:
an instance of a column or null if not found

getColumnByIndex

public Column<C> getColumnByIndex(int idx)
Description copied from interface: ColumnList
Queries column by index

Returns:

getSuperColumn

public <C2> Column<C2> getSuperColumn(C columnName,
                                      Serializer<C2> colSer)
Description copied from interface: ColumnList
Return the super column with the specified name

Returns:

getSuperColumn

public <C2> Column<C2> getSuperColumn(int idx,
                                      Serializer<C2> colSer)
Description copied from interface: ColumnList
Get super column by index

Returns:

isEmpty

public boolean isEmpty()
Description copied from interface: ColumnList
Indicates if the list of columns is empty

Returns:

size

public int size()
Description copied from interface: ColumnList
returns the number of columns in the row

Returns:

isSuperColumn

public boolean isSuperColumn()
Description copied from interface: ColumnList
Returns true if the columns are super columns with subcolumns. If true then use getSuperColumn to call children. Otherwise call getColumnByIndex and getColumnByName to get the standard columns in the list.

Returns:


Copyright © 2012. All Rights Reserved.