Class RowUtil
java.lang.Object
org.apache.derby.impl.sql.execute.RowUtil
Utility class manipulating rows.
Note: this class is public so it may be used by Replication execution code. It is basically not public.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static longRow count base added for testing JDBC 4.2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyCloneColumns(ExecRow to, ExecRow from, int count) Clone an ExecRow's columns and place the coloned columns in another ExecRow.static voidcopyRefColumns(ExecRow setMe) Empty columns -- i.e. make them refer to a java null.static voidcopyRefColumns(ExecRow to, int toStart, ExecRow from, int fromStart, int count) Copy references for an ExecRow's columns to another ExecRow.static voidcopyRefColumns(ExecRow to, ExecRow from) Copy references for an ExecRow's columns to another ExecRow.static voidcopyRefColumns(ExecRow to, ExecRow from, int count) Copy references for an ExecRow's columns to another ExecRow.static voidcopyRefColumns(ExecRow to, ExecRow from, int[] positions) Copy references for an ExecRow's columns to another ExecRow.static voidcopyRefColumns(ExecRow to, ExecRow from, int start, int count) Copy references for an ExecRow's columns to another ExecRow.static voidcopyRefColumns(ExecRow to, ExecRow from, FormatableBitSet positions) Copy references for an ExecRow's columns to another ExecRow.static ExecIndexRowgetEmptyIndexRow(int columnCount, LanguageConnectionContext lcc) Get an empty ExecIndexRow.static ExecRowgetEmptyValueRow(int columnCount, LanguageConnectionContext lcc) Get an empty ExecRow.static longRetrieve the row count basestatic booleaninAscendingOrder(int[] colMap) static StringintArrayToString(int[] colMap) intArrayToStringstatic voidsetRowCountBase(long newBase) Debug method used to test the setLargeMaxRows() method added by JDBC 4.2.static FormatableBitSetshift(FormatableBitSet bitSet, int n) Shift a FormatableBitSet N bits toward the zero end. e.g. shift({2,4}) -> {1,3}.static StringtoStringstatic StringtoStringstatic StringtoStringstatic StringtoStringstatic StringtoStringstatic StringtoString
-
Field Details
-
rowCountBase
private static long rowCountBaseRow count base added for testing JDBC 4.2
-
-
Constructor Details
-
RowUtil
public RowUtil()
-
-
Method Details
-
setRowCountBase
public static void setRowCountBase(long newBase) Debug method used to test the setLargeMaxRows() method added by JDBC 4.2. This method is a NOP on a production (insane) build of Derby. -
getRowCountBase
public static long getRowCountBase()Retrieve the row count base -
getEmptyValueRow
Get an empty ExecRow.- Parameters:
columnCount- the number of columns in the row.- Returns:
- the row.
-
getEmptyIndexRow
Get an empty ExecIndexRow.- Parameters:
columnCount- the number of columns in the row.- Returns:
- the row.
-
copyCloneColumns
-
copyRefColumns
-
copyRefColumns
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 arrayfrom- Get the column references from here. Compact arraypositions- array of 1-based column ids to copy from "from" to "to"- Throws:
StandardException
-
copyRefColumns
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
-
toString
-
toString
-
toString
-
toString
-
toString
-
intArrayToString
intArrayToString- Parameters:
colMap- the int array- Returns:
- the string
-
inAscendingOrder
public static boolean inAscendingOrder(int[] colMap) -
shift
Shift a FormatableBitSet N bits toward the zero end. e.g. shift({2,4}) -> {1,3}.- Parameters:
bitSet- the bit setn- the number of bits to shift- Returns:
- a new FormatableBitSet with the shifted result
-