com.nhncorp.neptune.client
Class Row

java.lang.Object
  extended by com.nhncorp.neptune.client.Row
All Implemented Interfaces:
com.nhncorp.neptune.common.io.NWritable, java.lang.Comparable<Row>, org.apache.hadoop.io.Writable

public class Row
extends java.lang.Object
implements com.nhncorp.neptune.common.io.NWritable, java.lang.Comparable<Row>, org.apache.hadoop.io.Writable

Row is Value Object which represents Table's row.
A Row object has multiple columns.
Each column has multiple Cell Objects


Nested Class Summary
static class Row.Key
          Row.Key class
 
Constructor Summary
Row()
           
Row(Row.Key key)
           
 
Method Summary
 void addCell(java.lang.String columnName, Cell newCell)
          Add Cell to specified column
 void addCellList(java.lang.String columnName, java.util.List<Cell> paramCells)
          Add Cell list to specified column
 void addCells(java.lang.String columnName, java.util.List<Cell> paramCells)
          Deprecated. Use addCellList()
 int compareTo(Row row)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Map<java.lang.String,java.util.TreeMap<Cell.Key,Cell>> getAllCells()
           
 Cell getCell(java.lang.String columnName, Cell.Key cellKey)
          Return Cell object.
 java.util.List<Cell> getCellList(java.lang.String columnName)
          Return cell list
 java.util.TreeMap<Cell.Key,Cell> getCellMap(java.lang.String columnName)
          Return Map of Cells
 java.util.TreeMap<Cell.Key,Cell> getCellMaps(java.lang.String columnName)
          Deprecated. Use getCellMap()
 java.util.List<Cell> getCells(java.lang.String columnName)
          Deprecated. Use getCellList()
 int getColumnCount()
          return number of columns(NTable.get() or scan)
 java.lang.String[] getColumnNames()
           
 int getColumnSize()
          Deprecated. Use getColumnCount()
 Cell getFirst(java.lang.String columnName)
          Return first Cell object in specified column
 java.util.List<Cell> getFirstColumnCellList()
          Return Cell list
This method must be used when called NTable.get() or scan with single column.
 java.util.List<Cell> getFirstColumnCells()
          Deprecated. Use getFirstColumnCellList()
 Row.Key getKey()
          Return Row.Key
 int getMaxNumCellValue()
          Return max number of Cell.Value
 Cell getOne(java.lang.String columnName)
          Deprecated. use getFirst()
 void print(java.lang.String columnName)
           
 void readFields(java.io.DataInput in)
          Reads the fields of this object from in.
 void setAllCells(java.util.Map<java.lang.String,java.util.TreeMap<Cell.Key,Cell>> cells)
           
 void setKey(Row.Key key)
           
 void write(java.io.DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Row

public Row()

Row

public Row(Row.Key key)
Method Detail

getColumnSize

public int getColumnSize()
Deprecated. Use getColumnCount()

Returns:

getColumnCount

public int getColumnCount()
return number of columns(NTable.get() or scan)

Returns:

getKey

public Row.Key getKey()
Return Row.Key

Returns:

addCell

public void addCell(java.lang.String columnName,
                    Cell newCell)
Add Cell to specified column

Parameters:
columnName -
newCell -

addCells

public void addCells(java.lang.String columnName,
                     java.util.List<Cell> paramCells)
Deprecated. Use addCellList()


addCellList

public void addCellList(java.lang.String columnName,
                        java.util.List<Cell> paramCells)
Add Cell list to specified column

Parameters:
columnName -
paramCells -

getCells

public java.util.List<Cell> getCells(java.lang.String columnName)
Deprecated. Use getCellList()

Parameters:
columnName -
Returns:

getCell

public Cell getCell(java.lang.String columnName,
                    Cell.Key cellKey)
Return Cell object.

Parameters:
columnName -
cellKey -
Returns:
cell 객체

getCellList

public java.util.List<Cell> getCellList(java.lang.String columnName)
Return cell list

Parameters:
columnName -
Returns:

getCellMaps

public java.util.TreeMap<Cell.Key,Cell> getCellMaps(java.lang.String columnName)
Deprecated. Use getCellMap()

Parameters:
columnName -
Returns:

getCellMap

public java.util.TreeMap<Cell.Key,Cell> getCellMap(java.lang.String columnName)
Return Map of Cells

Parameters:
columnName -
Returns:

getOne

public Cell getOne(java.lang.String columnName)
Deprecated. use getFirst()

Parameters:
columnName -
Returns:

getFirst

public Cell getFirst(java.lang.String columnName)
Return first Cell object in specified column

Parameters:
columnName -
Returns:

getFirstColumnCells

public java.util.List<Cell> getFirstColumnCells()
                                         throws java.io.IOException
Deprecated. Use getFirstColumnCellList()

Returns:
Throws:
java.io.IOException

getFirstColumnCellList

public java.util.List<Cell> getFirstColumnCellList()
                                            throws java.io.IOException
Return Cell list
This method must be used when called NTable.get() or scan with single column.
If getColumnCount() > 1, throws IOExcepiton.

Returns:
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Description copied from interface: com.nhncorp.neptune.common.io.NWritable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface com.nhncorp.neptune.common.io.NWritable
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from interface: com.nhncorp.neptune.common.io.NWritable
Writes the fields of this object to out.

Specified by:
write in interface com.nhncorp.neptune.common.io.NWritable
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

compareTo

public int compareTo(Row row)
Specified by:
compareTo in interface java.lang.Comparable<Row>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getAllCells

public java.util.Map<java.lang.String,java.util.TreeMap<Cell.Key,Cell>> getAllCells()

setAllCells

public void setAllCells(java.util.Map<java.lang.String,java.util.TreeMap<Cell.Key,Cell>> cells)

setKey

public void setKey(Row.Key key)

getColumnNames

public java.lang.String[] getColumnNames()

print

public void print(java.lang.String columnName)

getMaxNumCellValue

public int getMaxNumCellValue()
Return max number of Cell.Value

Returns: