| 1 19 20 package jode.expr; 21 import jode.type.Type; 22 import jode.bytecode.ClassInfo; 23 import jode.decompiler.Scope; 24 import jode.decompiler.TabbedPrintWriter; 25 26 public class ThisOperator extends NoArgOperator { 27 boolean isInnerMost; 28 ClassInfo classInfo; 29 30 public ThisOperator(ClassInfo classInfo, boolean isInnerMost) { 31 super(Type.tClass(classInfo)); 32 this.classInfo = classInfo; 33 this.isInnerMost = isInnerMost; 34 } 35 36 public ThisOperator(ClassInfo classInfo) { 37 this(classInfo, false); 38 } 39 40 public ClassInfo getClassInfo() { 41 return classInfo; 42 } 43 44 public int getPriority() { 45 return 1000; 46 } 47 48 public String toString() { 49 return classInfo+".this"; 50 } 51 52 public boolean opEquals(Operator o) { 53 return (o instanceof ThisOperator && 54 ((ThisOperator) o).classInfo.equals(classInfo)); 55 } 56 57 public void dumpExpression(TabbedPrintWriter writer) 58 throws java.io.IOException { 59 if (!isInnerMost) { 60 writer.print(writer.getClassString(classInfo, 61 Scope.AMBIGUOUSNAME)); 62 writer.print("."); 63 } 64 writer.print("this"); 65 } 66 } 67 | Popular Tags |