org.apache.derby.impl.sql.execute
Class ValueRow

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.ValueRow
All Implemented Interfaces:
ExecRow, java.io.Externalizable, Formatable, Row, java.io.Serializable, TypedFormat
Direct Known Subclasses:
IndexRow

public class ValueRow
extends java.lang.Object
implements ExecRow, Formatable

Basic implementation of ExecRow.

Author:
ames
See Also:
Serialized Form

Field Summary
private  DataValueDescriptor[] column
          This class implements Formatable.
private  int ncols
           
 
Constructor Summary
ValueRow()
          Public niladic constructor.
ValueRow(int ncols)
          Make a value row with a designated number of column slots.
 
Method Summary
 DataValueDescriptor cloneColumn(int columnPosition)
          Get a clone of a DataValueDescriptor from an ExecRow.
(package private)  ExecRow cloneMe()
           
 ExecRow getClone()
          Clone the Row and its contents.
 ExecRow getClone(FormatableBitSet clonedCols)
          Clone the Row.
 DataValueDescriptor getColumn(int position)
          Get a DataValueDescriptor in a Row by ordinal position (1-based).
 ExecRow getNewNullRow()
          Get a new row with the same columns type as this one, containing nulls.
 void getNewObjectArray()
          Get a new DataValueDescriptor[]
 DataValueDescriptor[] getRowArray()
          Get the array form of the row that Access expects.
 DataValueDescriptor[] getRowArrayClone()
          Get a clone of the array form of the row that Access expects.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 int nColumns()
           
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
protected  void realloc(int ncols)
           
 void setColumn(int position, DataValueDescriptor col)
          Set a DataValueDescriptor in a Row by ordinal position (1-based).
 void setRowArray(DataValueDescriptor[] value)
          Set the row array
 void setRowArray(Storable[] value)
          Set the array of objects
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

column

private DataValueDescriptor[] column
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method.


ncols

private int ncols
Constructor Detail

ValueRow

public ValueRow()
Public niladic constructor. Needed for Formatable interface to work.


ValueRow

public ValueRow(int ncols)
Make a value row with a designated number of column slots.

Parameters:
ncols - number of columns to allocate
Method Detail

nColumns

public int nColumns()
Specified by:
nColumns in interface Row

getNewObjectArray

public void getNewObjectArray()
Description copied from interface: ExecRow
Get a new DataValueDescriptor[]

Specified by:
getNewObjectArray in interface ExecRow

getColumn

public DataValueDescriptor getColumn(int position)
Description copied from interface: Row
Get a DataValueDescriptor in a Row by ordinal position (1-based).

Specified by:
getColumn in interface Row
Parameters:
position - The ordinal position of the column.
Returns:
The DataValueDescriptor, null if no such column exists

setColumn

public void setColumn(int position,
                      DataValueDescriptor col)
Description copied from interface: Row
Set a DataValueDescriptor in a Row by ordinal position (1-based).

Specified by:
setColumn in interface Row
Parameters:
position - The ordinal position of the column.
Returns:
The DataValueDescriptor, null if no such column exists

getClone

public ExecRow getClone()
Description copied from interface: ExecRow
Clone the Row and its contents.

Specified by:
getClone in interface ExecRow
Returns:
Row A clone of the Row and its contents.

getClone

public ExecRow getClone(FormatableBitSet clonedCols)
Description copied from interface: ExecRow
Clone the Row. The cloned row will contain clones of the specified columns and the same object as the original row for the other columns.

Specified by:
getClone in interface ExecRow
Parameters:
clonedCols - 1-based FormatableBitSet representing the columns to clone.
Returns:
Row A clone of the Row and its contents.

getNewNullRow

public ExecRow getNewNullRow()
Description copied from interface: ExecRow
Get a new row with the same columns type as this one, containing nulls.

Specified by:
getNewNullRow in interface ExecRow

cloneMe

ExecRow cloneMe()

cloneColumn

public final DataValueDescriptor cloneColumn(int columnPosition)
Description copied from interface: ExecRow
Get a clone of a DataValueDescriptor from an ExecRow.

Specified by:
cloneColumn in interface ExecRow

toString

public java.lang.String toString()

getRowArray

public DataValueDescriptor[] getRowArray()
Get the array form of the row that Access expects.

Specified by:
getRowArray in interface ExecRow
See Also:
ExecRow.getRowArray()

getRowArrayClone

public DataValueDescriptor[] getRowArrayClone()
Get a clone of the array form of the row that Access expects.

Specified by:
getRowArrayClone in interface ExecRow
See Also:
ExecRow.getRowArray()

setRowArray

public void setRowArray(DataValueDescriptor[] value)
Set the row array

Specified by:
setRowArray in interface ExecRow
See Also:
ExecRow.setRowArray(org.apache.derby.iapi.services.io.Storable[])

setRowArray

public void setRowArray(Storable[] value)
Description copied from interface: ExecRow
Set the array of objects

Specified by:
setRowArray in interface ExecRow

realloc

protected void realloc(int ncols)

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this object from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object to a stream of stored objects.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - write bytes here.
Throws:
java.io.IOException - thrown on error

getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
the formatID of this class

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.