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

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

public class IndexRow
extends ValueRow
implements ExecIndexRow

Basic implementation of ExecIndexRow.

Author:
jeff
See Also:
Serialized Form

Field Summary
private  boolean[] orderedNulls
          This class implements Formatable.
 
Fields inherited from class org.apache.derby.impl.sql.execute.ValueRow
 
Constructor Summary
IndexRow()
          Public niladic constructor.
IndexRow(int ncols)
           
 
Method Summary
 boolean areNullsOrdered(int columnPosition)
          Return true if orderedNulls was called on this ExecIndexRow for the given column position.
(package private)  ExecRow cloneMe()
           
 void execRowToExecIndexRow(ExecRow valueRow)
          Turn the ExecRow into an ExecIndexRow.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 void orderedNulls(int columnPosition)
          These two methods are a sort of a hack.
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class org.apache.derby.impl.sql.execute.ValueRow
cloneColumn, getClone, getClone, getColumn, getNewNullRow, getNewObjectArray, getRowArray, getRowArrayClone, nColumns, realloc, setColumn, setRowArray, setRowArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.sql.execute.ExecRow
cloneColumn, getClone, getClone, getNewNullRow, getNewObjectArray, getRowArray, getRowArrayClone, setRowArray, setRowArray
 
Methods inherited from interface org.apache.derby.iapi.sql.Row
getColumn, nColumns, setColumn
 

Field Detail

orderedNulls

private boolean[] orderedNulls
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.

Constructor Detail

IndexRow

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


IndexRow

public IndexRow(int ncols)
Method Detail

orderedNulls

public void orderedNulls(int columnPosition)
Description copied from interface: ExecIndexRow
These two methods are a sort of a hack. The store implements ordered null semantics for start and stop positioning, which is correct for IS NULL and incorrect for everything else. To work around this, TableScanResultSet will check whether the start and stop positions have NULL in any column position other than for an IS NULL check. If so, it won't do the scan (that is, it will return no rows). This method is to inform this ExecIndexRow (which can be used for start and stop positioning) that the given column uses ordered null semantics.

Specified by:
orderedNulls in interface ExecIndexRow
Parameters:
columnPosition - The position of the column that uses ordered null semantics (zero-based).

areNullsOrdered

public boolean areNullsOrdered(int columnPosition)
Description copied from interface: ExecIndexRow
Return true if orderedNulls was called on this ExecIndexRow for the given column position.

Specified by:
areNullsOrdered in interface ExecIndexRow
Parameters:
columnPosition - The position of the column (zero-based) for which we want to check if ordered null semantics are used.
Returns:
true if we are to use ordered null semantics on the given column

execRowToExecIndexRow

public void execRowToExecIndexRow(ExecRow valueRow)
Turn the ExecRow into an ExecIndexRow.

Specified by:
execRowToExecIndexRow in interface ExecIndexRow
Returns:
Nothing.

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
Overrides:
readExternal in class ValueRow
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
Overrides:
writeExternal in class ValueRow
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
Overrides:
getTypeFormatId in class ValueRow
Returns:
the formatID of this class

cloneMe

ExecRow cloneMe()
Overrides:
cloneMe in class ValueRow

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.