KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > execute > rts > RealNoPutResultSetStatistics


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.execute.rts.RealNoPutResultSetStatistics
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.execute.rts;
23
24 import org.apache.derby.iapi.services.io.Formatable;
25
26 import org.apache.derby.iapi.services.io.FormatableHashtable;
27
28 import java.io.ObjectOutput JavaDoc;
29 import java.io.ObjectInput JavaDoc;
30 import java.io.IOException JavaDoc;
31
32 /**
33   ResultSetStatistics implemenation for NoPutResultSetImpl.
34
35   @author jerry
36
37 */

38 abstract class RealNoPutResultSetStatistics
39     extends RealBasicNoPutResultSetStatistics
40 {
41     /* Leave these fields public for object inspectors */
42     public int resultSetNumber;
43
44     /* fields used for formating run time statistics output */
45     protected String JavaDoc indent;
46     protected String JavaDoc subIndent;
47     protected int sourceDepth;
48
49     // CONSTRUCTORS
50

51     /**
52      *
53      *
54      */

55     public RealNoPutResultSetStatistics(
56                                         int numOpens,
57                                         int rowsSeen,
58                                         int rowsFiltered,
59                                         long constructorTime,
60                                         long openTime,
61                                         long nextTime,
62                                         long closeTime,
63                                         int resultSetNumber,
64                                         double optimizerEstimatedRowCount,
65                                         double optimizerEstimatedCost
66                                         )
67     {
68         super(
69                 numOpens,
70                 rowsSeen,
71                 rowsFiltered,
72                 constructorTime,
73                 openTime,
74                 nextTime,
75                 closeTime,
76                 optimizerEstimatedRowCount,
77                 optimizerEstimatedCost
78                 );
79
80         this.resultSetNumber = resultSetNumber;
81     }
82  
83     /**
84      * Initialize the format info for run time statistics.
85      */

86     protected void initFormatInfo(int depth)
87     {
88         char[] indentchars = new char[depth];
89         char[] subIndentchars = new char[depth + 1];
90         sourceDepth = depth + 1;
91
92         /*
93         ** Form an array of tab characters for indentation.
94         */

95         subIndentchars[depth] = '\t';
96         while (depth > 0)
97         {
98             subIndentchars[depth - 1] = '\t';
99             indentchars[depth - 1] = '\t';
100             depth--;
101         }
102                 // convert char[] to String to avoid problems during
103
// String concatenation.
104
indent = new String JavaDoc(indentchars);
105                 subIndent = new String JavaDoc(subIndentchars);
106     }
107 }
108
Popular Tags