Class CstLiteral64

All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>
Direct Known Subclasses:
CstDouble, CstLong

public abstract class CstLiteral64 extends CstLiteralBits
Constants which are literal 64-bit values of some sort.
  • Method Details

    • equals

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

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • 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
    • isCategory2

      public final 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
    • fitsInInt

      public final boolean fitsInInt()
      Returns whether or not this instance's value may be accurately represented as an int. The rule is that if there is an int which may be sign-extended to yield this instance's value, then this method returns true. Otherwise, it returns false.
      Specified by:
      fitsInInt in class CstLiteralBits
      Returns:
      true iff this instance fits in an int
    • getIntBits

      public final int getIntBits()
      Gets the value as int bits. If this instance contains more bits than fit in an int, then this returns only the low-order bits.
      Specified by:
      getIntBits in class CstLiteralBits
      Returns:
      the bits
    • getLongBits

      public final long getLongBits()
      Gets the value as long bits. If this instance contains fewer bits than fit in a long, then the result of this method is the sign extension of the value.
      Specified by:
      getLongBits in class CstLiteralBits
      Returns:
      the bits