Java Doc for RowUtil.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » access » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.store.access 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.store.access.RowUtil

RowUtil
public class RowUtil (Code)
A set of static utility methods to work with rows.

A row or partial row is described by two or three parameters.

  1. DataValueDescriptor[] row - an array of objects, one per column.
  2. FormatableBitSet validColumns - an indication of which objects in row map to which columns
These objects can describe a complete row or a partial row. A partial row is one where a sub-set (e.g. columns 0, 4 and 7) of the columns are supplied for update, or requested to be fetched on a read. Here's an example of code to set up a partial column list to fetch the 0th (type FOO), 4th (type BAR), and 7th (type MMM) columns from a row with 10 columns, note that the format for a partial row changed from a "packed" representation in the 3.0 release to a "sparse" representation in later releases:
 // 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);
 

Column mapping
When validColumns is null:
  • The number of columns is given by row.length
  • Column N maps to row[N], where column numbers start at zero.

When validColumns is not null, then
  • The number of requested columns is given by the number of bits set in validColumns.
  • Column N is not in the partial row if validColumns.isSet(N) returns false.
  • Column N is in the partial row if validColumns.isSet(N) returns true.
  • If column N is in the partial row then it maps to row[N]. If N >= row.length then the column is taken as non existent for an insert or update, and not fetched on a fetch.
If row.length is greater than the number of columns indicated by validColumns the extra entries are ignored.


Field Summary
final public static  DataValueDescriptor[]EMPTY_ROW
     An object that can be used on a fetch to indicate no fields need to be fetched.
final public static  FormatableBitSetEMPTY_ROW_BITSET
     An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched.
final public static  FetchDescriptorEMPTY_ROW_FETCH_DESCRIPTOR
     An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched.
final public static  FetchDescriptor[]ROWUTIL_FETCH_DESCRIPTOR_CONSTANTS
    


Method Summary
public static  intcolumnOutOfRange(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.
public static  DataValueDescriptorgetColumn(DataValueDescriptor[] row, FormatableBitSet columnList, int columnId)
     Get the object for a column identifer (0 based) from a complete or partial row.
public static  ObjectgetColumn(Object[] row, FormatableBitSet columnList, int columnId)
    
final public static  FetchDescriptorgetFetchDescriptorConstant(int single_column_number)
     Return a FetchDescriptor which describes a single column set.
public static  intgetNumberOfColumns(int maxColumnNumber, FormatableBitSet columnList)
     Get the number of columns represented by a FormatableBitSet.

This is simply a count of the number of bits set in the FormatableBitSet.


Parameters:
  maxColumnNumber - Because the FormatableBitSet.size() can't be used asthe number of columns, allow caller to tellthe maximum column number if it knows.

public static  FormatableBitSetgetQualifierBitSet(Qualifier[][] qualifiers)
     Get a FormatableBitSet representing all the columns represented in a qualifier list.
public static  booleanisRowEmpty(DataValueDescriptor[] row)
     See if a row actually contains no columns.
public static  InstanceGetter[]newClassInfoTemplate(FormatableBitSet column_list, int[] format_ids)
     Generate a row of InstanceGetter objects to be used to generate "empty" rows.

Generate an array of InstanceGetter objects which will be used to make repeated calls to newRowFromClassInfoTemplate(), to repeatedly and efficiently generate new rows.

public static  DataValueDescriptor[]newRowFromClassInfoTemplate(InstanceGetter[] classinfo_template)
     Generate an "empty" row from an array of classInfo objects.

Generate an array of new'd objects by using the getNewInstance() method on each of the InstanceGetter objects.

public static  intnextColumn(Object[] row, FormatableBitSet columnList, int startColumn)
     Get the next valid column after or including start column.
final public static  booleanqualifyRow(Object[] row, Qualifier[][] qual_list)
     Process the qualifier list on the row, return true if it qualifies.

A two dimensional array is to be used to pass around a AND's and OR's in conjunctive normal form.

public static  StringtoString(Object[] row)
     return string version of row.

For debugging only.

public static  StringtoString(Hashtable hash_table)
     return string version of a HashTable returned from a FetchSet.

Field Detail
EMPTY_ROW
final public static DataValueDescriptor[] EMPTY_ROW(Code)
An object that can be used on a fetch to indicate no fields need to be fetched.



EMPTY_ROW_BITSET
final public static FormatableBitSet EMPTY_ROW_BITSET(Code)
An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched.



EMPTY_ROW_FETCH_DESCRIPTOR
final public static FetchDescriptor EMPTY_ROW_FETCH_DESCRIPTOR(Code)
An object that can be used on a fetch as a FormatableBitSet to indicate no fields need to be fetched.



ROWUTIL_FETCH_DESCRIPTOR_CONSTANTS
final public static FetchDescriptor[] ROWUTIL_FETCH_DESCRIPTOR_CONSTANTS(Code)





Method Detail
columnOutOfRange
public static int columnOutOfRange(DataValueDescriptor[] row, FormatableBitSet columnList, int maxColumns)(Code)
Return the column number of the first column out of range, or a number less than zero if all columns are in range.



getColumn
public static DataValueDescriptor getColumn(DataValueDescriptor[] row, FormatableBitSet columnList, int columnId)(Code)
Get the object for a column identifer (0 based) from a complete or partial row.
Parameters:
  row - the row
Parameters:
  columnList - valid columns in the row
Parameters:
  columnId - which column to return (0 based) the obejct for the column, or null if the column is not represented.



getColumn
public static Object getColumn(Object[] row, FormatableBitSet columnList, int columnId)(Code)



getFetchDescriptorConstant
final public static FetchDescriptor getFetchDescriptorConstant(int single_column_number)(Code)
Return a FetchDescriptor which describes a single column set.

This routine returns one of a set of constant FetchDescriptor's, and should not be altered by the caller.




getNumberOfColumns
public static int getNumberOfColumns(int maxColumnNumber, FormatableBitSet columnList)(Code)
Get the number of columns represented by a FormatableBitSet.

This is simply a count of the number of bits set in the FormatableBitSet.


Parameters:
  maxColumnNumber - Because the FormatableBitSet.size() can't be used asthe number of columns, allow caller to tellthe maximum column number if it knows. -1 means caller does not know.>=0 number is the largest column number.
Parameters:
  columnList - valid columns in the row The number of columns represented in the FormatableBitSet.




getQualifierBitSet
public static FormatableBitSet getQualifierBitSet(Qualifier[][] qualifiers)(Code)
Get a FormatableBitSet representing all the columns represented in a qualifier list. a FormatableBitSet describing the valid columns.



isRowEmpty
public static boolean isRowEmpty(DataValueDescriptor[] row)(Code)
See if a row actually contains no columns. Returns true if row is null or row.length is zero. true if row is empty.



newClassInfoTemplate
public static InstanceGetter[] newClassInfoTemplate(FormatableBitSet column_list, int[] format_ids) throws StandardException(Code)
Generate a row of InstanceGetter objects to be used to generate "empty" rows.

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.

The new row.
Parameters:
  format_ids - an array of format id's, one per column in row.
exception:
  StandardException - Standard exception policy.




newRowFromClassInfoTemplate
public static DataValueDescriptor[] newRowFromClassInfoTemplate(InstanceGetter[] classinfo_template) throws StandardException(Code)
Generate an "empty" row from an array of classInfo objects.

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.

The new row.
Parameters:
  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 emptytemplate row.
exception:
  StandardException - Standard exception policy.




nextColumn
public static int nextColumn(Object[] row, FormatableBitSet columnList, int startColumn)(Code)
Get the next valid column after or including start column. Returns -1 if no valid columns exist after startColumn



qualifyRow
final public static boolean qualifyRow(Object[] row, Qualifier[][] qual_list) throws StandardException(Code)
Process the qualifier list on the row, return true if it qualifies.

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]) true if the row qualifies.
Parameters:
  row - The row being qualified.
Parameters:
  qual_list - 2 dimensional array representing conjunctivenormal form of simple qualifiers.
exception:
  StandardException - Standard exception policy.




toString
public static String toString(Object[] row)(Code)
return string version of row.

For debugging only. The string version of row.
Parameters:
  row - The row.




toString
public static String toString(Hashtable hash_table)(Code)
return string version of a HashTable returned from a FetchSet.

The string version of row.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.