1 2 package org.quilt.cover.stmt; 3 4 import java.util.List ; 5 import java.util.Vector ; 6 7 11 12 class Ephemera { 13 14 15 private String className; 16 17 18 private static int counterCount; 19 20 21 private List methodEnds; 22 23 24 private List methodNames; 25 26 27 Ephemera (String name) { 28 className = name; 29 counterCount = 0; 30 methodEnds = new Vector (); 31 methodNames = new Vector (); 32 } 33 34 41 void setEndCount (String meName, int count) { 42 if (meName == null) { 43 throw new IllegalArgumentException ("null name"); 44 } 45 if (count < 0) { 46 throw new IllegalArgumentException ("negative count"); 47 } 48 if (count < counterCount) { 49 System.out.println("Ephemera.setEndCount WARNING: " 50 + "count now " + counterCount 51 + " but resetting to " + count); 52 } 53 if (methodEnds == null || methodNames == null) { 54 System.out.println( 55 "Ephemera.setEndCount INTERNAL ERROR: methodEnds/Names is null"); 56 } else { 57 methodNames.add(meName); 58 methodEnds.add(new Integer (count)); 59 } 60 counterCount = count; 61 } 62 63 String getClassName() { 64 return className; 65 } 66 67 int getCounterCount() { 68 return counterCount; 69 } 70 71 List getMethodNames () { 72 return methodNames; 73 } 74 75 List getMethodEnds () { 76 return methodEnds; 77 } 78 } 79 | Popular Tags |