1 21 22 package org.apache.derby.impl.store.access.conglomerate; 23 24 import org.apache.derby.iapi.error.StandardException; 25 26 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo; 27 import org.apache.derby.iapi.store.access.RowUtil; 28 29 import org.apache.derby.iapi.types.DataValueDescriptor; 30 31 import org.apache.derby.iapi.services.io.FormatableBitSet; 32 import org.apache.derby.iapi.services.loader.InstanceGetter; 33 34 40 41 public class OpenConglomerateScratchSpace 42 implements DynamicCompiledOpenConglomInfo 43 { 44 45 49 50 57 private FormatableBitSet row_for_export_column_list; 58 private InstanceGetter[] row_for_export_class_template; 59 60 65 private DataValueDescriptor[] scratch_template; 66 67 72 private DataValueDescriptor[] scratch_row; 73 74 77 private int[] format_ids; 78 79 83 public OpenConglomerateScratchSpace( 84 int[] format_ids) 85 { 86 this.format_ids = format_ids; 87 } 88 89 93 94 98 99 111 public DataValueDescriptor[] get_row_for_export() 112 throws StandardException 113 { 114 if (row_for_export_class_template == null) 117 { 118 row_for_export_class_template = 119 RowUtil.newClassInfoTemplate( 120 row_for_export_column_list, format_ids); 121 } 122 123 return( 125 RowUtil.newRowFromClassInfoTemplate(row_for_export_class_template)); 126 } 127 128 142 public DataValueDescriptor[] get_scratch_row() 143 throws StandardException 144 { 145 if (scratch_row == null) 148 { 149 scratch_row = get_row_for_export(); 150 } 151 152 return(scratch_row); 154 } 155 156 167 public DataValueDescriptor[] get_template() 168 throws StandardException 169 { 170 if (scratch_template == null) 172 { 173 scratch_template = TemplateRow.newRow((FormatableBitSet) null, format_ids); 174 } 175 176 return(scratch_template); 177 } 178 179 184 public void init( 185 FormatableBitSet export_column_list) 186 { 187 row_for_export_class_template = null; 188 row_for_export_column_list = null; 189 } 190 } 191 | Popular Tags |