|
|
@ -29,17 +29,29 @@ import java.util.Hashtable; |
|
|
|
* null. It is always garanteed that topType is an Array or an Object |
|
|
|
* null. It is always garanteed that topType is an Array or an Object |
|
|
|
* and that bottomType is null or an Array or an Object. <p> |
|
|
|
* and that bottomType is null or an Array or an Object. <p> |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* The hintType gives a hint which type it probably is. It is used to |
|
|
|
|
|
|
|
* generate the type declaration. |
|
|
|
|
|
|
|
* |
|
|
|
* @author Jochen Hoenicke |
|
|
|
* @author Jochen Hoenicke |
|
|
|
* @date 98/08/06 |
|
|
|
* @date 98/08/06 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class RangeType extends Type { |
|
|
|
public class RangeType extends Type { |
|
|
|
final Type bottomType; |
|
|
|
final Type bottomType; |
|
|
|
final Type topType; |
|
|
|
final Type topType; |
|
|
|
|
|
|
|
final Type hintType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RangeType(Type bottomType, Type topType, Type hintType) { |
|
|
|
|
|
|
|
super(TC_RANGE); |
|
|
|
|
|
|
|
this.bottomType = bottomType; |
|
|
|
|
|
|
|
this.topType = topType; |
|
|
|
|
|
|
|
this.hintType = hintType; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RangeType(Type bottomType, Type topType) { |
|
|
|
public RangeType(Type bottomType, Type topType) { |
|
|
|
super(TC_RANGE); |
|
|
|
super(TC_RANGE); |
|
|
|
this.bottomType = bottomType; |
|
|
|
this.bottomType = bottomType; |
|
|
|
this.topType = topType; |
|
|
|
this.topType = topType; |
|
|
|
|
|
|
|
this.hintType = bottomType.isValidType() ? bottomType : topType; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Type getBottom() { |
|
|
|
public Type getBottom() { |
|
|
@ -50,6 +62,10 @@ public class RangeType extends Type { |
|
|
|
return topType; |
|
|
|
return topType; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Type getHint() { |
|
|
|
|
|
|
|
return hintType.getHint(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create the type corresponding to the range from bottomType to this. |
|
|
|
* Create the type corresponding to the range from bottomType to this. |
|
|
|
* @param bottomType the start point of the range |
|
|
|
* @param bottomType the start point of the range |
|
|
@ -107,18 +123,17 @@ public class RangeType extends Type { |
|
|
|
public String toString() |
|
|
|
public String toString() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (jode.Decompiler.isTypeDebugging) |
|
|
|
if (jode.Decompiler.isTypeDebugging) |
|
|
|
return "<" + bottomType + "-" + topType + ">"; |
|
|
|
return "<" + bottomType + "-" + hintType + "-" + topType + ">"; |
|
|
|
if (topType.isClassType() || !bottomType.isValidType()) |
|
|
|
return hintType.toString(); |
|
|
|
return topType.toString(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return bottomType.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getDefaultName() { |
|
|
|
public String getDefaultName() { |
|
|
|
if (topType.isClassType() || !bottomType.isValidType()) |
|
|
|
return hintType.getDefaultName(); |
|
|
|
return topType.getDefaultName(); |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
return bottomType.getDefaultName(); |
|
|
|
public int hashCode() { |
|
|
|
|
|
|
|
int hashcode = topType.hashCode(); |
|
|
|
|
|
|
|
return (hashcode << 16 | hashcode >>> 16) ^ bottomType.hashCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean equals(Object o) { |
|
|
|
public boolean equals(Object o) { |
|
|
|