org.h2.result
Class RowImpl

java.lang.Object
  extended by org.h2.result.Row
      extended by org.h2.result.RowImpl
All Implemented Interfaces:
SearchRow

public class RowImpl
extends Row

Default row implementation.


Field Summary
 
Fields inherited from class org.h2.result.Row
EMPTY_ARRAY, MEMORY_CALCULATE
 
Constructor Summary
RowImpl(Value[] data, int memory)
           
 
Method Summary
 void commit()
          This record has been committed.
 int getByteCount(Data dummy)
          Get the number of bytes required for the data.
 int getColumnCount()
          Get the column count.
 Row getCopy()
          Get a copy of the row that is distinct from (not equal to) this row.
 long getKey()
          Get the unique key of the row.
 int getMemory()
          Get the estimated memory used for this row, in bytes.
 int getSessionId()
          Get session id.
 Value getValue(int i)
          Get the value for the column
 Value[] getValueList()
          Get values.
 int getVersion()
          Get the version of the row.
 boolean isDeleted()
          Check if the row is deleted.
 boolean isEmpty()
          Check if this is an empty row.
 void setDeleted(boolean deleted)
          Mark the row as deleted.
 void setKey(long key)
          Set the unique key of the row.
 void setKeyAndVersion(SearchRow row)
          Set the position and version to match another row.
 void setSessionId(int sessionId)
          Set session id.
 void setValue(int i, Value v)
          Set the value for given column
 void setVersion(int version)
          Set version.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RowImpl

public RowImpl(Value[] data,
               int memory)
Method Detail

getCopy

public Row getCopy()
Get a copy of the row that is distinct from (not equal to) this row. This is used for FOR UPDATE to allow pseudo-updating a row.

Specified by:
getCopy in class Row
Returns:
a new row with the same data

setKeyAndVersion

public void setKeyAndVersion(SearchRow row)
Description copied from interface: SearchRow
Set the position and version to match another row.

Parameters:
row - the other row.

getVersion

public int getVersion()
Description copied from interface: SearchRow
Get the version of the row.

Returns:
the version

setVersion

public void setVersion(int version)
Description copied from class: Row
Set version.

Specified by:
setVersion in class Row
Parameters:
version - row version

getKey

public long getKey()
Description copied from interface: SearchRow
Get the unique key of the row.

Returns:
the key

setKey

public void setKey(long key)
Description copied from interface: SearchRow
Set the unique key of the row.

Parameters:
key - the key

getValue

public Value getValue(int i)
Description copied from interface: SearchRow
Get the value for the column

Parameters:
i - the column number (starting with 0)
Returns:
the value

getByteCount

public int getByteCount(Data dummy)
Get the number of bytes required for the data.

Specified by:
getByteCount in class Row
Parameters:
dummy - the template buffer
Returns:
the number of bytes

setValue

public void setValue(int i,
                     Value v)
Description copied from interface: SearchRow
Set the value for given column

Parameters:
i - the column number (starting with 0)
v - the new value

isEmpty

public boolean isEmpty()
Description copied from class: Row
Check if this is an empty row.

Specified by:
isEmpty in class Row
Returns:
true if the row is empty

getColumnCount

public int getColumnCount()
Description copied from interface: SearchRow
Get the column count.

Returns:
the column count

getMemory

public int getMemory()
Description copied from interface: SearchRow
Get the estimated memory used for this row, in bytes.

Returns:
the memory

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setDeleted

public void setDeleted(boolean deleted)
Description copied from class: Row
Mark the row as deleted.

Specified by:
setDeleted in class Row
Parameters:
deleted - deleted flag

setSessionId

public void setSessionId(int sessionId)
Description copied from class: Row
Set session id.

Specified by:
setSessionId in class Row
Parameters:
sessionId - the session id

getSessionId

public int getSessionId()
Description copied from class: Row
Get session id.

Specified by:
getSessionId in class Row
Returns:
the session id

commit

public void commit()
This record has been committed. The session id is reset.

Specified by:
commit in class Row

isDeleted

public boolean isDeleted()
Description copied from class: Row
Check if the row is deleted.

Specified by:
isDeleted in class Row
Returns:
true if the row is deleted

getValueList

public Value[] getValueList()
Description copied from class: Row
Get values.

Specified by:
getValueList in class Row
Returns:
values