1 30 31 34 35 package jbet; 36 import java.util.*; 37 38 public class DagClassInfo 39 { 40 public String thisClass; 41 public String superClass; 42 public Vector interfaces; 43 public Vector methods; 44 public Vector fields; 45 46 47 48 public DagClassInfo (ClassInfo cr) 49 { 50 thisClass = cr.thisClass; 51 superClass = cr.superClass; 52 interfaces = (Vector) cr.interfaces.clone(); 53 fields = cr.fields; 54 methods = new Vector(); 55 56 for (int i = 0; i < cr.methods.size(); i++) { 57 DagMethodInfo mi = new DagMethodInfo (this, cr.methodAt (i)); 58 methods.addElement (mi); 59 } 60 } 61 62 public DagClassInfo (ClassInfo cr, boolean runGraphify) throws ClassFileException, DataFlowException, ElementNotFoundException 63 { 64 this (cr, runGraphify, ClassFilter.ALL); 65 } 66 67 public DagClassInfo (ClassInfo cr, boolean runGraphify, ClassFilter fixcons) 68 throws ClassFileException, DataFlowException, ElementNotFoundException 69 { 70 thisClass = cr.thisClass; 71 superClass = cr.superClass; 72 interfaces = (Vector) cr.interfaces.clone(); 73 fields = cr.fields; 74 methods = new Vector(); 75 76 for (int i = 0; i < cr.methods.size(); i++) { 77 DagMethodInfo mi = new DagMethodInfo (this, cr.methodAt (i)); 78 if (runGraphify) { 79 mi.dags = DagSnippit.graphify (cr.methodAt (i), fixcons); 80 if (mi.dags != null) 81 ((DagSnippit)mi.dags).method = mi; 82 } 83 methods.addElement (mi); 84 } 85 } 86 87 88 89 public String name() 90 { 91 return thisClass; 92 } 93 94 public String toString() 95 { 96 return thisClass; 97 } 98 99 public DagMethodInfo methodAt (int i) 100 { 101 return (DagMethodInfo) methods.elementAt (i); 102 } 103 104 public String interfaceAt(int i) { 105 return (String ) interfaces.elementAt(i); 106 } 107 public FieldInfo fieldAt(int i) { 108 return (FieldInfo) fields.elementAt(i); 109 } 110 } 111 | Popular Tags |