1 21 22 package org.apache.derby.impl.sql.execute.rts; 23 24 import org.apache.derby.iapi.services.io.Formatable; 25 import org.apache.derby.iapi.services.i18n.MessageService; 26 import org.apache.derby.iapi.reference.SQLState; 27 28 import java.io.ObjectOutput ; 29 import java.io.ObjectInput ; 30 import java.io.IOException ; 31 32 import java.util.Vector ; 33 34 40 abstract class RealNoRowsResultSetStatistics 41 implements ResultSetStatistics 42 { 43 44 45 46 47 48 protected String indent; 49 protected String subIndent; 50 protected int sourceDepth; 51 public ResultSetStatistics sourceResultSetStatistics; 52 protected long executeTime; 53 54 public long inspectOverall; 57 public long inspectNum; 58 public String inspectDesc; 59 60 62 66 public RealNoRowsResultSetStatistics(long executeTime, 67 ResultSetStatistics sourceRS) 68 { 69 if (sourceRS instanceof RealBasicNoPutResultSetStatistics) 70 this.executeTime = executeTime - 71 ((RealBasicNoPutResultSetStatistics)sourceRS).getTotalTime(); 72 } 73 74 77 protected void initFormatInfo(int depth) 78 { 79 char [] indentchars = new char[depth]; 80 char [] subIndentchars = new char[depth + 1]; 81 sourceDepth = depth + 1; 82 83 86 subIndentchars[depth] = '\t'; 87 while (depth > 0) 88 { 89 subIndentchars[depth - 1] = '\t'; 90 indentchars[depth - 1] = '\t'; 91 depth--; 92 } 93 94 indent = new String (indentchars); 95 subIndent = new String (subIndentchars); 96 } 97 98 103 protected String dumpTimeStats(String indent) 104 { 105 return 106 indent + MessageService.getTextMessage(SQLState.RTS_EXECUTE_TIME) + 107 " = " + executeTime + "\n"; 108 } 109 116 public Vector getChildren(){ 117 Vector children = new Vector (); 118 children.addElement(sourceResultSetStatistics); 119 return children; 120 } 121 122 126 public abstract String getNodeName(); 127 128 135 public double getEstimatedRowCount() 136 { 137 return 0.0; 138 } 139 } 140 | Popular Tags |