Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / impl / sql / execute / IndexValueRow.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/impl/sql/execute/IndexValueRow.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/impl/sql/execute/IndexValueRow.java
new file mode 100644 (file)
index 0000000..4cbf07e
--- /dev/null
@@ -0,0 +1,151 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.impl.sql.execute.IndexValueRow\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.impl.sql.execute;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+import org.apache.derby.iapi.services.io.FormatableBitSet;\r
+import org.apache.derby.iapi.services.io.Storable;\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+import org.apache.derby.iapi.sql.execute.ExecIndexRow;\r
+import org.apache.derby.iapi.sql.execute.ExecRow;\r
+import org.apache.derby.iapi.types.DataValueDescriptor;\r
+\r
+/**\r
+       Mapper of ValueRow into ExecIndexRow. \r
+\r
+ */\r
+class IndexValueRow implements ExecIndexRow {\r
+\r
+       private ExecRow valueRow;\r
+\r
+       IndexValueRow(ExecRow valueRow) {\r
+                this.valueRow = valueRow;\r
+       }\r
+\r
+       /*\r
+        * class interface\r
+        */\r
+       public String toString() {\r
+               return valueRow.toString();\r
+       }\r
+\r
+\r
+       /**\r
+               Get the array form of the row that Access expects.\r
+\r
+               @see ExecRow#getRowArray\r
+       */\r
+       public DataValueDescriptor[] getRowArray() {\r
+               return valueRow.getRowArray();\r
+       }\r
+\r
+       /**     @see ExecRow#getRowArray */\r
+       public void setRowArray(DataValueDescriptor[] value) \r
+       {\r
+               valueRow.setRowArray(value);\r
+       }\r
+\r
+       /**\r
+               Get a clone of the array form of the row that Access expects.\r
+\r
+               @see ExecRow#getRowArray\r
+       */\r
+       public DataValueDescriptor[] getRowArrayClone() \r
+       {\r
+               return valueRow.getRowArrayClone();\r
+       }\r
+\r
+       // this is the actual current # of columns\r
+       public int nColumns() {\r
+               return valueRow.nColumns();\r
+       }\r
+\r
+       /*\r
+        * Row interface\r
+        */\r
+       // position is 1-based\r
+       public DataValueDescriptor      getColumn (int position) throws StandardException {\r
+               return valueRow.getColumn(position);\r
+       }\r
+\r
+       // position is 1-based.\r
+       public void setColumn(int position, DataValueDescriptor col) {\r
+               valueRow.setColumn(position, col);\r
+       }\r
+\r
+       // position is 1-based\r
+       public ExecRow getClone() {\r
+               return new IndexValueRow(valueRow.getClone());\r
+       }\r
+\r
+       public ExecRow getClone(FormatableBitSet clonedCols) {\r
+               return new IndexValueRow(valueRow.getClone(clonedCols));\r
+       }\r
+\r
+       public ExecRow getNewNullRow() {\r
+               return new IndexValueRow(valueRow.getNewNullRow());\r
+       }\r
+\r
+    /**\r
+     * Reset all columns in the row array to null values.\r
+     */\r
+    public void resetRowArray() {\r
+        valueRow.resetRowArray();\r
+    }\r
+\r
+       // position is 1-based\r
+       public DataValueDescriptor cloneColumn(int columnPosition)\r
+       {\r
+               return valueRow.cloneColumn(columnPosition);\r
+       }\r
+\r
+       /*\r
+        * ExecIndexRow interface\r
+        */\r
+\r
+       public void orderedNulls(int columnPosition) {\r
+               if (SanityManager.DEBUG) {\r
+                       SanityManager.THROWASSERT("Not expected to be called");\r
+               }\r
+       }\r
+\r
+       public boolean areNullsOrdered(int columnPosition) {\r
+               if (SanityManager.DEBUG) {\r
+                       SanityManager.THROWASSERT("Not expected to be called");\r
+               }\r
+\r
+               return false;\r
+       }\r
+\r
+       /**\r
+        * Turn the ExecRow into an ExecIndexRow.\r
+        */\r
+       public void execRowToExecIndexRow(ExecRow valueRow)\r
+       {\r
+               this.valueRow = valueRow;\r
+       }\r
+\r
+       public void getNewObjectArray() \r
+       {\r
+               valueRow.getNewObjectArray();\r
+       }\r
+}\r