You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
677 B
28 lines
677 B
26 years ago
|
package jode;
|
||
|
import sun.tools.java.Type;
|
||
|
|
||
|
public class InstanceOfOperator extends SimpleOperator {
|
||
|
Type classType;
|
||
|
|
||
|
public InstanceOfOperator(int addr, int length, Type type) {
|
||
|
super(addr, length, Type.tBoolean, 0, 1);
|
||
|
this.operandTypes[0] = UnknownType.tSubClass(type);
|
||
|
this.classType = type;
|
||
|
}
|
||
|
public int getOperandCount() {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
public int getPriority() {
|
||
|
return 550;
|
||
|
}
|
||
|
|
||
|
public int getOperandPriority(int i) {
|
||
|
return getPriority();
|
||
|
}
|
||
|
|
||
|
public String toString(CodeAnalyzer ca, String[] operands) {
|
||
|
return operands[0] + " instanceof "+ca.getTypeString(classType);
|
||
|
}
|
||
|
}
|