1 21 22 package org.apache.derbyTesting.unitTests.store; 23 24 import org.apache.derby.iapi.store.raw.*; 25 26 import org.apache.derby.iapi.store.access.*; 27 import org.apache.derby.iapi.types.SQLChar; 28 29 import org.apache.derby.iapi.types.DataValueDescriptor; 30 31 import java.io.*; 32 33 37 public class T_RawStoreRow { 38 39 DataValueDescriptor[] col; 40 41 public T_RawStoreRow(int numberOfColumns) { 42 super(); 43 col = new DataValueDescriptor[numberOfColumns]; 44 } 45 46 public T_RawStoreRow(String data) { 47 this(1); 48 col[0] = data == null ? new SQLChar() : new SQLChar(data); 49 } 50 51 public DataValueDescriptor[] getRow() { 52 return col; 53 } 54 55 public void setColumn(int columnId, String data) 56 { 57 col[columnId] = data == null ? new SQLChar() : new SQLChar(data); 58 } 59 60 public void setColumn(int columnId, int stringLen, String data) 61 { 62 col[columnId] = new SQLChar(T_Util.getStringFromData(data, stringLen)); 64 } 65 66 public void setColumn(int columnId, DataValueDescriptor data) 67 { 68 col[columnId] = data; 69 } 70 71 public DataValueDescriptor getStorableColumn(int columnId) { 72 73 return col[columnId]; 74 } 75 76 public DataValueDescriptor getColumn(int columnId) { 77 78 return col[columnId]; 79 } 80 81 public void setStorableColumn(int columnId, DataValueDescriptor value) { 82 83 col[columnId] = value; 84 } 85 86 public int nColumns() { 87 return col.length; 88 } 89 90 public String toString() { 91 StringBuffer sb = new StringBuffer (""); 92 for (int i = 0; i < nColumns(); i++) { 93 sb.append(col[i].toString()); 94 if (i < (nColumns() - 1)) 95 sb.append(","); 96 } 97 sb.append(""); 98 99 return sb.toString(); 100 } 101 } 102 103 | Popular Tags |