Fields Summary |
---|
private static final HashMap | interns{@code non-null;} map of interned types |
public static final CstType | OBJECT{@code non-null;} instance corresponding to the class {@code Object} |
public static final CstType | BOOLEAN{@code non-null;} instance corresponding to the class {@code Boolean} |
public static final CstType | BYTE{@code non-null;} instance corresponding to the class {@code Byte} |
public static final CstType | CHARACTER{@code non-null;} instance corresponding to the class {@code Character} |
public static final CstType | DOUBLE{@code non-null;} instance corresponding to the class {@code Double} |
public static final CstType | FLOAT{@code non-null;} instance corresponding to the class {@code Float} |
public static final CstType | LONG{@code non-null;} instance corresponding to the class {@code Long} |
public static final CstType | INTEGER{@code non-null;} instance corresponding to the class {@code Integer} |
public static final CstType | SHORT{@code non-null;} instance corresponding to the class {@code Short} |
public static final CstType | VOID{@code non-null;} instance corresponding to the class {@code Void} |
public static final CstType | BOOLEAN_ARRAY{@code non-null;} instance corresponding to the type {@code boolean[]} |
public static final CstType | BYTE_ARRAY{@code non-null;} instance corresponding to the type {@code byte[]} |
public static final CstType | CHAR_ARRAY{@code non-null;} instance corresponding to the type {@code char[]} |
public static final CstType | DOUBLE_ARRAY{@code non-null;} instance corresponding to the type {@code double[]} |
public static final CstType | FLOAT_ARRAY{@code non-null;} instance corresponding to the type {@code float[]} |
public static final CstType | LONG_ARRAY{@code non-null;} instance corresponding to the type {@code long[]} |
public static final CstType | INT_ARRAY{@code non-null;} instance corresponding to the type {@code int[]} |
public static final CstType | SHORT_ARRAY{@code non-null;} instance corresponding to the type {@code short[]} |
private final com.android.dexgen.rop.type.Type | type{@code non-null;} the underlying type |
private CstUtf8 | descriptor{@code null-ok;} the type descriptor corresponding to this instance, if
calculated |
Methods Summary |
---|
protected int | compareTo0(Constant other){@inheritDoc}
String thisDescriptor = type.getDescriptor();
String otherDescriptor = ((CstType) other).type.getDescriptor();
return thisDescriptor.compareTo(otherDescriptor);
|
public boolean | equals(java.lang.Object other){@inheritDoc}
if (!(other instanceof CstType)) {
return false;
}
return type == ((CstType) other).type;
|
public static com.android.dexgen.rop.cst.CstType | forBoxedPrimitiveType(com.android.dexgen.rop.type.Type primitiveType)Returns an instance of this class that represents the wrapper
class corresponding to a given primitive type. For example, if
given {@link Type#INT}, this method returns the class reference
{@code java.lang.Integer}.
switch (primitiveType.getBasicType()) {
case Type.BT_BOOLEAN: return BOOLEAN;
case Type.BT_BYTE: return BYTE;
case Type.BT_CHAR: return CHARACTER;
case Type.BT_DOUBLE: return DOUBLE;
case Type.BT_FLOAT: return FLOAT;
case Type.BT_INT: return INTEGER;
case Type.BT_LONG: return LONG;
case Type.BT_SHORT: return SHORT;
case Type.BT_VOID: return VOID;
}
throw new IllegalArgumentException("not primitive: " + primitiveType);
|
public com.android.dexgen.rop.type.Type | getClassType()Gets the underlying type (as opposed to the type corresponding
to this instance as a constant, which is always
{@code Class}).
return type;
|
public CstUtf8 | getDescriptor()Gets the type descriptor for this instance.
if (descriptor == null) {
descriptor = new CstUtf8(type.getDescriptor());
}
return descriptor;
|
public com.android.dexgen.rop.type.Type | getType(){@inheritDoc}
return Type.CLASS;
|
public int | hashCode(){@inheritDoc}
return type.hashCode();
|
public static com.android.dexgen.rop.cst.CstType | intern(com.android.dexgen.rop.type.Type type)Returns an interned instance of this class for the given type.
CstType cst = interns.get(type);
if (cst == null) {
cst = new CstType(type);
interns.put(type, cst);
}
return cst;
|
public static com.android.dexgen.rop.cst.CstType | intern(java.lang.Class clazz)Returns an interned instance of this class for the given
{@code Class} instance.
return intern(Type.intern(clazz));
|
public boolean | isCategory2(){@inheritDoc}
return false;
|
public java.lang.String | toHuman(){@inheritDoc}
return type.toHuman();
|
public java.lang.String | toString(){@inheritDoc}
return "type{" + toHuman() + '}";
|
public java.lang.String | typeName(){@inheritDoc}
return "type";
|