Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class RowUtil

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ExecIndexRow, .ExecRow

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

Modifier and TypeField and Description
private static long
rowCountBase

Row count base added for testing JDBC 4.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
copyCloneColumns(ExecRow
Place the cloned columns here.
to
,
ExecRow
Get the columns to clone here.
from
,
int
Clone this number of columns.
count
)

Clone an ExecRow's columns and place the coloned columns in another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here.
to
,
ExecRow
Get the column references from here.
from
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here.
to
,
ExecRow
Get the column references from here.
from
,
int
Copy this number of column references.
count
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here.
to
,
ExecRow
Get the column references from here.
from
,
int
The 0 based index of the first column to copy.
start
,
int
Copy this number of column references.
count
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here.
to
,
int
The 0-based index of the first column to replace.
toStart
,
ExecRow
Get the column references from here.
from
,
int
The 0 based index of the first column to copy.
fromStart
,
int
Copy this number of column references.
count
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here.
to
,
ExecRow
Get the column references from here.
from
,
int[]
array of 1-based column ids to copy from "from" to "to"
positions
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Place the column references here. Sparse array
to
,
ExecRow
Get the column references from here. Compact array
from
,
FormatableBitSet
array of 1-based column ids to copy from "from" to "to"
positions
)

Copy references for an ExecRow's columns to another ExecRow.

public static void
copyRefColumns(ExecRow
Set columns in this storable to be empty.
setMe
)

Empty columns -- i.e. make them refer to a java null.

public static ExecIndexRow

Returns:

the row.
getEmptyIndexRow
(int
the number of columns in the row.
columnCount
,
LanguageConnectionContext lcc)

Get an empty ExecIndexRow.

public static ExecRow

Returns:

the row.
getEmptyValueRow
(int
the number of columns in the row.
columnCount
,
LanguageConnectionContext lcc)

Get an empty ExecRow.

public static long
getRowCountBase()

Retrieve the row count base

public static boolean
inAscendingOrder(int[] colMap)

public static String

Returns:

the string
intArrayToString
(int[]
the int array
colMap
)

intArrayToString

public static void
setRowCountBase(long newBase)

Debug method used to test the setLargeMaxRows() method added by JDBC 4.2.

public static FormatableBitSet

Returns:

a new FormatableBitSet with the shifted result
shift
(FormatableBitSet
the bit set
bitSet
,
int
the number of bits to shift
n
)

Shift a FormatableBitSet N bits toward the zero end.

public static String

Returns:

the string
toString
(ExecRow
the row
row
)

toString

public static String

Returns:

the string
toString
(Object[]
the row array
objs
)

toString

public static String

Returns:

the string
toString
(ExecRow
the row
row
,
int
0 based start point in row array, inclusive
startPoint
,
int
0 based end point in row array, inclusive
endPoint
)

toString

public static String

Returns:

the string
toString
(Object[]
the row array
objs
,
int
0 based start point in row array, inclusive
startPoint
,
int
0 based end point in row array, inclusive
endPoint
)

toString

public static String

Returns:

the string
toString
(ExecRow
the row
row
,
int[]
1 based array of positions
positions
)

toString

public static String

Returns:

the string
toString
(Object[]
the row array
objs
,
int[]
1 based array of positions
positions
)

toString

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rowCountBaseback to summary
private static long rowCountBase

Row count base added for testing JDBC 4.2

Constructor Detail

RowUtilback to summary
public RowUtil()

Method Detail

copyCloneColumnsback to summary
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:ExecRow

Place the cloned columns here.

from:ExecRow

Get the columns to clone here.

count:int

Clone this number of columns.

copyRefColumnsback to summary
public static void copyRefColumns(ExecRow to, ExecRow from)

Copy references for an ExecRow's columns to another ExecRow.

Parameters
to:ExecRow

Place the column references here.

from:ExecRow

Get the column references from here.

copyRefColumnsback to summary
public static void copyRefColumns(ExecRow to, ExecRow from, int count) throws StandardException

Copy references for an ExecRow's columns to another ExecRow.

Parameters
to:ExecRow

Place the column references here.

from:ExecRow

Get the column references from here.

count:int

Copy this number of column references.

copyRefColumnsback to summary
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:ExecRow

Place the column references here.

from:ExecRow

Get the column references from here.

start:int

The 0 based index of the first column to copy.

count:int

Copy this number of column references.

copyRefColumnsback to summary
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:ExecRow

Place the column references here.

toStart:int

The 0-based index of the first column to replace.

from:ExecRow

Get the column references from here.

fromStart:int

The 0 based index of the first column to copy.

count:int

Copy this number of column references.

copyRefColumnsback to summary
public static void copyRefColumns(ExecRow to, ExecRow from, int[] positions) throws StandardException

Copy references for an ExecRow's columns to another ExecRow.

Parameters
to:ExecRow

Place the column references here.

from:ExecRow

Get the column references from here.

positions:int[]

array of 1-based column ids to copy from "from" to "to"

copyRefColumnsback to summary
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:ExecRow

Place the column references here. Sparse array

from:ExecRow

Get the column references from here. Compact array

positions:FormatableBitSet

array of 1-based column ids to copy from "from" to "to"

copyRefColumnsback to summary
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:ExecRow

Set columns in this storable to be empty.

getEmptyIndexRowback to summary
public static ExecIndexRow getEmptyIndexRow(int columnCount, LanguageConnectionContext lcc)

Get an empty ExecIndexRow.

Parameters
columnCount:int

the number of columns in the row.

Returns:ExecIndexRow

the row.

getEmptyValueRowback to summary
public static ExecRow getEmptyValueRow(int columnCount, LanguageConnectionContext lcc)

Get an empty ExecRow.

Parameters
columnCount:int

the number of columns in the row.

Returns:ExecRow

the row.

getRowCountBaseback to summary
public static long getRowCountBase()

Retrieve the row count base

inAscendingOrderback to summary
public static boolean inAscendingOrder(int[] colMap)
intArrayToStringback to summary
public static String intArrayToString(int[] colMap)

intArrayToString

Parameters
colMap:int[]

the int array

Returns:String

the string

setRowCountBaseback to summary
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.

shiftback to summary
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:FormatableBitSet

the bit set

n:int

the number of bits to shift

Returns:FormatableBitSet

a new FormatableBitSet with the shifted result

toStringback to summary
public static String toString(ExecRow row)

toString

Parameters
row:ExecRow

the row

Returns:String

the string

toStringback to summary
public static String toString(Object[] objs)

toString

Parameters
objs:Object[]

the row array

Returns:String

the string

toStringback to summary
public static String toString(ExecRow row, int startPoint, int endPoint)

toString

Parameters
row:ExecRow

the row

startPoint:int

0 based start point in row array, inclusive

endPoint:int

0 based end point in row array, inclusive

Returns:String

the string

toStringback to summary
public static String toString(Object[] objs, int startPoint, int endPoint)

toString

Parameters
objs:Object[]

the row array

startPoint:int

0 based start point in row array, inclusive

endPoint:int

0 based end point in row array, inclusive

Returns:String

the string

toStringback to summary
public static String toString(ExecRow row, int[] positions)

toString

Parameters
row:ExecRow

the row

positions:int[]

1 based array of positions

Returns:String

the string

toStringback to summary
public static String toString(Object[] objs, int[] positions)

toString

Parameters
objs:Object[]

the row array

positions:int[]

1 based array of positions

Returns:String

the string