1 17 package org.apache.bcel.verifier.structurals; 18 19 20 21 28 29 public class Frame{ 30 31 37 protected static UninitializedObjectType _this; 38 39 42 private LocalVariables locals; 43 44 47 private OperandStack stack; 48 49 52 public Frame(int maxLocals, int maxStack){ 53 locals = new LocalVariables(maxLocals); 54 stack = new OperandStack(maxStack); 55 } 56 57 60 public Frame(LocalVariables locals, OperandStack stack){ 61 this.locals = locals; 62 this.stack = stack; 63 } 64 65 68 protected Object clone(){ 69 Frame f = new Frame(locals.getClone(), stack.getClone()); 70 return f; 71 } 72 73 76 public Frame getClone(){ 77 return (Frame) clone(); 78 } 79 80 83 public LocalVariables getLocals(){ 84 return locals; 85 } 86 87 90 public OperandStack getStack(){ 91 return stack; 92 } 93 94 96 public int hashCode() { return stack.hashCode() ^ locals.hashCode(); } 97 98 101 public boolean equals(Object o){ 102 if (!(o instanceof Frame)) { 103 return false; } 105 Frame f = (Frame) o; 106 return this.stack.equals(f.stack) && this.locals.equals(f.locals); 107 } 108 109 112 public String toString(){ 113 String s="Local Variables:\n"; 114 s += locals; 115 s += "OperandStack:\n"; 116 s += stack; 117 return s; 118 } 119 } 120 | Popular Tags |