01: /*
02:
03: Derby - Class org.apache.derby.impl.sql.execute.rts.RealNoPutResultSetStatistics
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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;
29: import java.io.ObjectInput;
30: import java.io.IOException;
31:
32: /**
33: ResultSetStatistics implemenation for NoPutResultSetImpl.
34:
35: @author jerry
36:
37: */
38: abstract class RealNoPutResultSetStatistics extends
39: RealBasicNoPutResultSetStatistics {
40: /* Leave these fields public for object inspectors */
41: public int resultSetNumber;
42:
43: /* fields used for formating run time statistics output */
44: protected String indent;
45: protected String subIndent;
46: protected int sourceDepth;
47:
48: // CONSTRUCTORS
49:
50: /**
51: *
52: *
53: */
54: public RealNoPutResultSetStatistics(int numOpens, int rowsSeen,
55: int rowsFiltered, long constructorTime, long openTime,
56: long nextTime, long closeTime, int resultSetNumber,
57: double optimizerEstimatedRowCount,
58: double optimizerEstimatedCost) {
59: super (numOpens, rowsSeen, rowsFiltered, constructorTime,
60: openTime, nextTime, closeTime,
61: optimizerEstimatedRowCount, optimizerEstimatedCost);
62:
63: this .resultSetNumber = resultSetNumber;
64: }
65:
66: /**
67: * Initialize the format info for run time statistics.
68: */
69: protected void initFormatInfo(int depth) {
70: char[] indentchars = new char[depth];
71: char[] subIndentchars = new char[depth + 1];
72: sourceDepth = depth + 1;
73:
74: /*
75: ** Form an array of tab characters for indentation.
76: */
77: subIndentchars[depth] = '\t';
78: while (depth > 0) {
79: subIndentchars[depth - 1] = '\t';
80: indentchars[depth - 1] = '\t';
81: depth--;
82: }
83: // convert char[] to String to avoid problems during
84: // String concatenation.
85: indent = new String(indentchars);
86: subIndent = new String(subIndentchars);
87: }
88: }
|