getTypeClass

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@523 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 1b9c1c468f
commit b00b9012ff
  1. 9
      jode/jode/type/ClassInterfacesType.java
  2. 16
      jode/jode/type/IntegerType.java
  3. 7
      jode/jode/type/RangeType.java

@ -397,6 +397,15 @@ public class ClassInterfacesType extends ReferenceType {
return "Ljava/lang/Object;"; return "Ljava/lang/Object;";
} }
public Class getTypeClass() throws ClassNotFoundException {
if (clazz != null)
return Class.forName(clazz.getName());
else if (ifaces.length > 0)
return Class.forName(ifaces[0].getName());
else
return Class.forName("java.lang.Object");
}
public String toString() public String toString()
{ {
if (this == tObject) if (this == tObject)

@ -163,6 +163,22 @@ public class IntegerType extends Type {
} }
} }
public Class getTypeClass() {
switch (((IntegerType)getHint()).possTypes) {
case IT_Z:
return Boolean.TYPE;
case IT_C:
return Character.TYPE;
case IT_B:
return Byte.TYPE;
case IT_S:
return Short.TYPE;
case IT_I:
default:
return Integer.TYPE;
}
}
public String toString() { public String toString() {
switch (possTypes) { switch (possTypes) {
case IT_Z: case IT_Z:

@ -122,6 +122,13 @@ public class RangeType extends Type {
return bottomType.getTypeSignature(); return bottomType.getTypeSignature();
} }
public Class getTypeClass() throws ClassNotFoundException {
if (topType.isClassType() || !bottomType.isValidType())
return topType.getTypeClass();
else
return bottomType.getTypeClass();
}
public String toString() public String toString()
{ {
if (topType == tNull) if (topType == tNull)

Loading…
Cancel
Save