Comments added

getSubType reworked...


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@901 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 25 years ago
parent 95dc01b153
commit 0a34c2eaaa
  1. 32
      jode/jode/type/ClassInterfacesType.java

@ -81,6 +81,18 @@ public class ClassInterfacesType extends ReferenceType {
return new ClassInterfacesType(clazz, ifaces);
}
public Type getSubType() {
if ((clazz == null && ifaces.length == 1)
|| ifaces.length == 0)
return tRange(this, tNull);
/* We don't implement the set of types, that are castable to some
* of the given classes or interfaces.
*/
throw new jode.AssertError
("getSubType called on set of classes and interfaces!");
}
public Type getHint() {
if (ifaces.length == 0
|| (clazz == null && ifaces.length == 1))
@ -91,6 +103,16 @@ public class ClassInterfacesType extends ReferenceType {
return Type.tClass(ifaces[0].getName());
}
public Type getCanonic() {
if (ifaces.length == 0
|| (clazz == null && ifaces.length == 1))
return this;
if (clazz != null)
return Type.tClass(clazz.getName());
else
return Type.tClass(ifaces[0].getName());
}
/**
* Create the type corresponding to the range from bottomType to
* this. Checks if the given type range may be not empty. This
@ -471,10 +493,20 @@ public class ClassInterfacesType extends ReferenceType {
|| (clazz == null && ifaces.length == 1);
}
/**
* Checks if this is a class or array type (but not a null type).
* @XXX remove this?
* @return true if this is a class or array type.
*/
public boolean isClassType() {
return true;
}
/**
* Generates the default name, that is the `natural' choice for
* local of this type.
* @return the default name of a local of this type.
*/
public String getDefaultName() {
ClassInfo type;
if (clazz != null)

Loading…
Cancel
Save