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

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.RowUtil

public class RowUtil
extends java.lang.Object

Utility class manipulating rows.

Note: this class is public so it may be used by Replication execution code. It is basically not public.


Constructor Summary
RowUtil()
           
 
Method Summary
static void copyCloneColumns(ExecRow to, ExecRow from, int count)
          Clone an ExecRow's columns and place the coloned columns in another ExecRow.
static void copyRefColumns(ExecRow setMe)
          Empty columns -- i.e. make them refer to a java null.
static void copyRefColumns(ExecRow to, ExecRow from)
          Copy references for an ExecRow's columns to another ExecRow.
static void copyRefColumns(ExecRow to, ExecRow from, FormatableBitSet positions)
          Copy references for an ExecRow's columns to another ExecRow.
static void copyRefColumns(ExecRow to, ExecRow from, int count)
          Copy references for an ExecRow's columns to another ExecRow.
static void copyRefColumns(ExecRow to, ExecRow from, int[] positions)
          Copy references for an ExecRow's columns to another ExecRow.
static void copyRefColumns(ExecRow to, ExecRow from, int start, int count)
          Copy references for an ExecRow's columns to another ExecRow.
static void copyRefColumns(ExecRow to, int toStart, ExecRow from, int fromStart, int count)
          Copy references for an ExecRow's columns to another ExecRow.
static ExecIndexRow getEmptyIndexRow(int columnCount, LanguageConnectionContext lcc)
          Get an empty ExecIndexRow.
static ExecRow getEmptyValueRow(int columnCount, LanguageConnectionContext lcc)
          Get an empty ExecRow.
static boolean inAscendingOrder(int[] colMap)
           
static java.lang.String intArrayToString(int[] colMap)
          intArrayToString
static FormatableBitSet shift(FormatableBitSet bitSet, int n)
          Shift a FormatableBitSet N bits toward the zero end.
static java.lang.String toString(ExecRow row)
          toString
static java.lang.String toString(ExecRow row, int[] positions)
          toString
static java.lang.String toString(ExecRow row, int startPoint, int endPoint)
          toString
static java.lang.String toString(java.lang.Object[] objs)
          toString
static java.lang.String toString(java.lang.Object[] objs, int[] positions)
          toString
static java.lang.String toString(java.lang.Object[] objs, int startPoint, int endPoint)
          toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowUtil

public RowUtil()
Method Detail

getEmptyValueRow

public static ExecRow getEmptyValueRow(int columnCount,
                                       LanguageConnectionContext lcc)
Get an empty ExecRow.

Parameters:
columnCount - the number of columns in the row.
Returns:
the row.

getEmptyIndexRow

public static ExecIndexRow getEmptyIndexRow(int columnCount,
                                            LanguageConnectionContext lcc)
Get an empty ExecIndexRow.

Parameters:
columnCount - the number of columns in the row.
Returns:
the row.

copyCloneColumns

public static void copyCloneColumns(ExecRow to,
                                    ExecRow from,
                                    int count)
Clone an ExecRow's columns and place the coloned columns in another ExecRow.

Parameters:
to - Place the cloned columns here.
from - Get the columns to clone here.
count - Clone this number of columns.

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  ExecRow from)
Copy references for an ExecRow's columns to another ExecRow.

Parameters:
to - Place the column references here.
from - Get the column references from here.

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  ExecRow from,
                                  int count)
                           throws StandardException
Copy references for an ExecRow's columns to another ExecRow.

Parameters:
to - Place the column references here.
from - Get the column references from here.
count - Copy this number of column references.
Throws:
StandardException

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  ExecRow from,
                                  int start,
                                  int count)
                           throws StandardException
Copy references for an ExecRow's columns to another ExecRow.

Parameters:
to - Place the column references here.
from - Get the column references from here.
start - The 0 based index of the first column to copy.
count - Copy this number of column references.
Throws:
StandardException

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  int toStart,
                                  ExecRow from,
                                  int fromStart,
                                  int count)
                           throws StandardException
Copy references for an ExecRow's columns to another ExecRow.

Parameters:
to - Place the column references here.
toStart - The 0-based index of the first column to replace.
from - Get the column references from here.
fromStart - The 0 based index of the first column to copy.
count - Copy this number of column references.
Throws:
StandardException

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  ExecRow from,
                                  int[] positions)
                           throws StandardException
Copy references for an ExecRow's columns to another ExecRow.

Parameters:
to - Place the column references here.
from - Get the column references from here.
positions - array of 1-based column ids to copy from "from" to "to"
Throws:
StandardException

copyRefColumns

public static void copyRefColumns(ExecRow to,
                                  ExecRow from,
                                  FormatableBitSet positions)
                           throws StandardException
Copy references for an ExecRow's columns to another ExecRow. For copying from a compact array to a reconstituted array. E.g. if positions = {2, 4}, and from = {666, 777} then to => {null, 666, null, 777}. Will only go as far as to.getArray().length.

Parameters:
to - Place the column references here. Sparse array
from - Get the column references from here. Compact array
positions - array of 1-based column ids to copy from "from" to "to"
Throws:
StandardException

copyRefColumns

public static void copyRefColumns(ExecRow setMe)
                           throws StandardException
Empty columns -- i.e. make them refer to a java null.

This is useful to remove dangling references to a column.

Parameters:
setMe - Set columns in this storable to be empty.
Throws:
StandardException

toString

public static java.lang.String toString(ExecRow row)
toString

Parameters:
row - the row
Returns:
the string

toString

public static java.lang.String toString(java.lang.Object[] objs)
toString

Parameters:
objs - the row array
Returns:
the string

toString

public static java.lang.String toString(ExecRow row,
                                        int startPoint,
                                        int endPoint)
toString

Parameters:
row - the row
startPoint - 0 based start point in row array, inclusive
endPoint - 0 based end point in row array, inclusive
Returns:
the string

toString

public static java.lang.String toString(java.lang.Object[] objs,
                                        int startPoint,
                                        int endPoint)
toString

Parameters:
objs - the row array
startPoint - 0 based start point in row array, inclusive
endPoint - 0 based end point in row array, inclusive
Returns:
the string

toString

public static java.lang.String toString(ExecRow row,
                                        int[] positions)
toString

Parameters:
row - the row
positions - 1 based array of positions
Returns:
the string

toString

public static java.lang.String toString(java.lang.Object[] objs,
                                        int[] positions)
toString

Parameters:
objs - the row array
positions - 1 based array of positions
Returns:
the string

intArrayToString

public static java.lang.String intArrayToString(int[] colMap)
intArrayToString

Parameters:
colMap - the int array
Returns:
the string

inAscendingOrder

public static boolean inAscendingOrder(int[] colMap)

shift

public static FormatableBitSet shift(FormatableBitSet bitSet,
                                     int n)
Shift a FormatableBitSet N bits toward the zero end. e.g. shift({2,4}) -> {1,3}.

Parameters:
bitSet - the bit set
n - the number of bits to shift
Returns:
a new FormatableBitSet with the shifted result

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.