1 19 20 package jode.expr; 21 import jode.type.Type; 22 import jode.decompiler.TabbedPrintWriter; 23 24 public class ConvertOperator extends Operator { 25 Type from; 26 27 public ConvertOperator(Type from, Type to) { 28 super(to, 0); 29 this.from = from; 30 initOperands(1); 31 } 32 33 public boolean opEquals(Operator o) { 34 return (o instanceof ConvertOperator) 35 && type == o.type; 36 } 37 38 public int getPriority() { 39 return 700; 40 } 41 42 public void updateSubTypes() { 43 subExpressions[0].setType(Type.tSubType(from)); 44 } 45 public void updateType() { 46 } 47 48 public void dumpExpression(TabbedPrintWriter writer) 49 throws java.io.IOException { 50 writer.print("("); 51 writer.printType(type.getCanonic()); 52 writer.print(") "); 53 subExpressions[0].dumpExpression(writer, 700); 54 } 55 } 56 | Popular Tags |