Package org.jf.dexlib2.iface.reference
Interface TypeReference
-
- All Superinterfaces:
java.lang.CharSequence
,java.lang.Comparable<java.lang.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
,ReflectionClassDef
public interface TypeReference extends Reference, java.lang.CharSequence, java.lang.Comparable<java.lang.CharSequence>
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareTo(java.lang.CharSequence o)
Compare this TypeReference to another TypeReference, or more generally to another CharSequence.boolean
equals(java.lang.Object o)
Compares this TypeReference to another TypeReference, or more generally to another CharSequence for equality.java.lang.String
getType()
Gets the string representation of the referenced type.int
hashCode()
Returns a hashcode for this TypeReference.-
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, length, subSequence, toString
-
Methods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
-
-
-
Method Detail
-
getType
@Nonnull java.lang.String 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()- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code value for this TypeReference
-
equals
boolean equals(@Nullable java.lang.Object o)
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()).- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The object to be compared for equality with this TypeReference- Returns:
- true if the specified object is equal to this TypeReference
-
compareTo
int compareTo(@Nonnull java.lang.CharSequence o)
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:
compareTo
in interfacejava.lang.Comparable<java.lang.CharSequence>
- Parameters:
o
- The CharSequence to compare with this TypeReference- Returns:
- An integer representing the result of the comparison
-
-