Package org.jf.dexlib2.iface.reference
Interface TypeReference
- All Superinterfaces:
CharSequence,Comparable<CharSequence>,Reference
- All Known Subinterfaces:
ClassDef,MethodParameter
- All Known Implementing Classes:
BaseMethodParameter,BaseTypeReference,BuilderClassDef,BuilderMethodParameter,BuilderTypeReference,ClassDefRewriter.RewrittenClassDef,DexBackedClassDef,DexBackedTypeReference,ImmutableClassDef,ImmutableMethodParameter,ImmutableTypeReference,MethodParameterRewriter.RewrittenMethodParameter,PoolClassDef,ReflectionClassDef,SmaliMethodParameter
This class represents a reference to a type.
When possible, elsewhere in the interface, a type is referenced directly as a String. A TypeReference is only used
in those cases where a generic Reference is needed
The type being referenced is represented as a String in the format of a TypeDescriptor, as defined by the dex file
specification.
This type also acts as a CharSequence wrapper around the TypeDescriptor string. As per the CharSequence contract,
calling toString() on a TypeReference yields the type descriptor as a String. This is the same value returned by
getType()
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException -
Method Summary
Modifier and TypeMethodDescriptionintCompare this TypeReference to another TypeReference, or more generally to another CharSequence.booleanCompares this TypeReference to another TypeReference, or more generally to another CharSequence for equality.getType()Gets the string representation of the referenced type.inthashCode()Returns a hashcode for this TypeReference.Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, isEmpty, length, subSequence, toStringMethods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
Method Details
-
getType
Gets the string representation of the referenced type. The returned string will be a TypeDescriptor, as defined in the dex file specification- Returns:
- The string representation of the referenced type.
-
hashCode
int hashCode()Returns a hashcode for this TypeReference. This is defined to be getType().hashCode() -
equals
Compares this TypeReference to another TypeReference, or more generally to another CharSequence for equality. This TypeReference is equal to a CharSequence iff this.getType().equals(other.toString()). Equivalently, This TypeReference is equal to another TypeReference iff this.getType().equals(other.getType()). -
compareTo
Compare this TypeReference to another TypeReference, or more generally to another CharSequence. The comparison is defined to be this.getType().compareTo(other.toString())- Specified by:
compareToin interfaceComparable<CharSequence>- Parameters:
o- The CharSequence to compare with this TypeReference- Returns:
- An integer representing the result of the comparison
-