Class CstInvokeDynamic

java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.CstInvokeDynamic
All Implemented Interfaces:
ToHuman, Comparable<Constant>

public final class CstInvokeDynamic extends Constant
Constants of type InvokeDynamic. These are present in the class file.
  • Method Details

    • make

      public static CstInvokeDynamic make(int bootstrapMethodIndex, CstNat nat)
      Makes an instance for the given value. This may (but does not necessarily) return an already-allocated instance.
      Parameters:
      bootstrapMethodIndex - The index of the bootstrap method in the bootstrap method table
      nat - the name and type
      Returns:
      non-null; the appropriate instance
    • addReference

      public CstCallSiteRef addReference()
      Creates a CstCallSiteRef that refers to this instance.
      Returns:
      non-null; a reference to this instance
    • getReferences

      public List<CstCallSiteRef> getReferences()
      Gets the list of references to this instance.
      Returns:
      non-null; the list of references to this instance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • typeName

      public String typeName()
      Returns the human name for the particular type of constant this instance is.
      Specified by:
      typeName in class Constant
      Returns:
      non-null; the name
    • toHuman

      public String toHuman()
      Return the "human" string form of this instance. This is generally less "debuggy" than toString().
      Returns:
      non-null; the human string form
    • isCategory2

      public boolean isCategory2()
      Returns true if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, or false if this instance is category-1.
      Specified by:
      isCategory2 in class Constant
      Returns:
      true iff this instance is category-2
    • compareTo0

      protected int compareTo0(Constant other)
      Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.
      Specified by:
      compareTo0 in class Constant
      Parameters:
      other - non-null; the instance to compare to
      Returns:
      -1, 0, or 1, as usual for a comparison
    • getBootstrapMethodIndex

      public int getBootstrapMethodIndex()
      Gets the bootstrap method index.
      Returns:
      the bootstrap method index
    • getNat

      public CstNat getNat()
      Gets the CstNat value.
      Returns:
      the name and type
    • getPrototype

      public Prototype getPrototype()
      Gets the Prototype of the invokedynamic call site.
      Returns:
      the invokedynamic call site prototype
    • getReturnType

      public Type getReturnType()
      Gets the return type.
      Returns:
      non-null; the return type
    • setDeclaringClass

      public void setDeclaringClass(CstType declaringClass)
      Sets the declaring class of this instance. This is a set-once property.
      Parameters:
      declaringClass - non-null; the declaring class
    • getDeclaringClass

      public CstType getDeclaringClass()
      Gets the declaring class of this instance.
      Returns:
      the declaring class
    • setCallSite

      public void setCallSite(CstCallSite callSite)
      Sets the call site associated with this instance. This is set-once property.
      Parameters:
      callSite - non-null; the call site created for this instance
    • getCallSite

      public CstCallSite getCallSite()
      Gets the call site associated with this instance.
      Returns:
      the call site associated with this instance