|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.store.access.RowUtil
A set of static utility methods to work with rows.
A row or partial row is described by two or three parameters.
// allocate/initialize the row DataValueDescriptor row = new DataValueDescriptor[10] row[0] = new FOO(); row[4] = new BAR(); row[7] = new MMM(); // allocate/initialize the bit set FormatableBitSet FormatableBitSet = new FormatableBitSet(10); FormatableBitSet.set(0); FormatableBitSet.set(4); FormatableBitSet.set(7);
Field Summary | |
static DataValueDescriptor[] |
EMPTY_ROW
An object that can be used on a fetch to indicate no fields need to be fetched. |
static FormatableBitSet |
EMPTY_ROW_BITSET
An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched. |
static FetchDescriptor |
EMPTY_ROW_FETCH_DESCRIPTOR
An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched. |
static FetchDescriptor[] |
ROWUTIL_FETCH_DESCRIPTOR_CONSTANTS
|
Constructor Summary | |
private |
RowUtil()
|
Method Summary | |
static int |
columnOutOfRange(DataValueDescriptor[] row,
FormatableBitSet columnList,
int maxColumns)
Return the column number of the first column out of range, or a number less than zero if all columns are in range. |
static DataValueDescriptor |
getColumn(DataValueDescriptor[] row,
FormatableBitSet columnList,
int columnId)
Get the object for a column identifer (0 based) from a complete or partial row. |
static java.lang.Object |
getColumn(java.lang.Object[] row,
FormatableBitSet columnList,
int columnId)
|
static FetchDescriptor |
getFetchDescriptorConstant(int single_column_number)
Return a FetchDescriptor which describes a single column set. |
static int |
getNumberOfColumns(int maxColumnNumber,
FormatableBitSet columnList)
Get the number of columns represented by a FormatableBitSet. |
static FormatableBitSet |
getQualifierBitSet(Qualifier[][] qualifiers)
Get a FormatableBitSet representing all the columns represented in a qualifier list. |
static boolean |
isRowEmpty(DataValueDescriptor[] row,
FormatableBitSet columnList)
See if a row actually contains no columns. |
static InstanceGetter[] |
newClassInfoTemplate(FormatableBitSet column_list,
int[] format_ids)
Generate a row of InstanceGetter objects to be used to generate "empty" rows. |
static DataValueDescriptor[] |
newRowFromClassInfoTemplate(InstanceGetter[] classinfo_template)
Generate an "empty" row from an array of classInfo objects. |
private static void |
newRowFromClassInfoTemplateError()
|
static int |
nextColumn(java.lang.Object[] row,
FormatableBitSet columnList,
int startColumn)
Get the next valid column after or including start column. |
static boolean |
qualifyRow(java.lang.Object[] row,
Qualifier[][] qual_list)
Process the qualifier list on the row, return true if it qualifies. |
static java.lang.String |
toString(java.util.Hashtable hash_table)
return string version of a HashTable returned from a FetchSet. |
static java.lang.String |
toString(java.lang.Object[] row)
return string version of row. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final DataValueDescriptor[] EMPTY_ROW
public static final FormatableBitSet EMPTY_ROW_BITSET
public static final FetchDescriptor EMPTY_ROW_FETCH_DESCRIPTOR
public static final FetchDescriptor[] ROWUTIL_FETCH_DESCRIPTOR_CONSTANTS
Constructor Detail |
private RowUtil()
Method Detail |
public static DataValueDescriptor getColumn(DataValueDescriptor[] row, FormatableBitSet columnList, int columnId)
row
- the rowcolumnList
- valid columns in the rowcolumnId
- which column to return (0 based)
public static java.lang.Object getColumn(java.lang.Object[] row, FormatableBitSet columnList, int columnId)
public static FormatableBitSet getQualifierBitSet(Qualifier[][] qualifiers)
public static int getNumberOfColumns(int maxColumnNumber, FormatableBitSet columnList)
This is simply a count of the number of bits set in the FormatableBitSet.
maxColumnNumber
- Because the FormatableBitSet.size() can't be used as
the number of columns, allow caller to tell
the maximum column number if it knows.
-1 means caller does not know.
>=0 number is the largest column number.columnList
- valid columns in the row
public static boolean isRowEmpty(DataValueDescriptor[] row, FormatableBitSet columnList)
public static int columnOutOfRange(DataValueDescriptor[] row, FormatableBitSet columnList, int maxColumns)
public static int nextColumn(java.lang.Object[] row, FormatableBitSet columnList, int startColumn)
public static final FetchDescriptor getFetchDescriptorConstant(int single_column_number)
This routine returns one of a set of constant FetchDescriptor's, and should not be altered by the caller.
public static InstanceGetter[] newClassInfoTemplate(FormatableBitSet column_list, int[] format_ids) throws StandardException
Generate an array of InstanceGetter objects which will be used to make repeated calls to newRowFromClassInfoTemplate(), to repeatedly and efficiently generate new rows. This is important for certain applications like the sorter and fetchSet which generate large numbers of "new" empty rows.
format_ids
- an array of format id's, one per column in row.
StandardException
- Standard exception policy.private static void newRowFromClassInfoTemplateError()
public static DataValueDescriptor[] newRowFromClassInfoTemplate(InstanceGetter[] classinfo_template) throws StandardException
Generate an array of new'd objects by using the getNewInstance() method on each of the InstanceGetter objects. It is more efficient to allocate new objects based on this "cache'd" InstanceGetter object than to call the Monitor to generate a new class from a format id.
classinfo_template
- An array of InstanceGetter objects each of
which can be used to create a new instance
of the appropriate type to build a new empty
template row.
StandardException
- Standard exception policy.public static java.lang.String toString(java.lang.Object[] row)
For debugging only.
row
- The row.
public static java.lang.String toString(java.util.Hashtable hash_table)
public static final boolean qualifyRow(java.lang.Object[] row, Qualifier[][] qual_list) throws StandardException
A two dimensional array is to be used to pass around a AND's and OR's in conjunctive normal form. The top slot of the 2 dimensional array is optimized for the more frequent where no OR's are present. The first array slot is always a list of AND's to be treated as described above for single dimensional AND qualifier arrays. The subsequent slots are to be treated as AND'd arrays or OR's. Thus the 2 dimensional array qual[][] argument is to be treated as the following, note if qual.length = 1 then only the first array is valid and it is and an array of and clauses: (qual[0][0] and qual[0][0] ... and qual[0][qual[0].length - 1]) and (qual[1][0] or qual[1][1] ... or qual[1][qual[1].length - 1]) and (qual[2][0] or qual[2][1] ... or qual[2][qual[2].length - 1]) ... and (qual[qual.length - 1][0] or qual[1][1] ... or qual[1][2])
row
- The row being qualified.qual_list
- 2 dimensional array representing conjunctive
normal form of simple qualifiers.
StandardException
- Standard exception policy.
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |