Class CstProtoRef

All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>

public final class CstProtoRef extends TypedConstant
Prototype reference.
  • Constructor Details Link icon

    • CstProtoRef Link icon

      public CstProtoRef(Prototype prototype)
  • Method Details Link icon

    • make Link icon

      public static CstProtoRef make(CstString descriptor)
      Makes an instance for the given value. This may (but does not necessarily) return an already-allocated instance.
      Parameters:
      descriptor - the method descriptor
      Returns:
      non-null; the appropriate instance
    • equals Link icon

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isCategory2 Link icon

      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
    • typeName Link icon

      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
    • compareTo0 Link icon

      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
    • toHuman Link icon

      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
    • toString Link icon

      public final String toString()
      Overrides:
      toString in class Object
    • getPrototype Link icon

      public Prototype getPrototype()
    • getType Link icon

      public Type getType()
      Description copied from interface: TypeBearer
      Gets the type associated with this instance.
      Returns:
      non-null; the type