com.android.dx.rop.cst
Class CstLiteral32

java.lang.Object
  extended by com.android.dx.rop.cst.Constant
      extended by com.android.dx.rop.cst.TypedConstant
          extended by com.android.dx.rop.cst.CstLiteralBits
              extended by com.android.dx.rop.cst.CstLiteral32
All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>
Direct Known Subclasses:
CstBoolean, CstByte, CstChar, CstFloat, CstInteger, CstShort

public abstract class CstLiteral32
extends CstLiteralBits

Constants which are literal 32-bit values of some sort.


Method Summary
protected  int compareTo0(Constant other)
          Compare the values of this and another instance, which are guaranteed to be of the same class.
 boolean equals(Object other)
          
 boolean fitsInInt()
          Returns whether or not this instance's value may be accurately represented as an int.
 int getIntBits()
          Gets the value as int bits.
 long getLongBits()
          Gets the value as long bits.
 int hashCode()
          
 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.
 
Methods inherited from class com.android.dx.rop.cst.CstLiteralBits
fitsIn16Bits, fitsIn8Bits
 
Methods inherited from class com.android.dx.rop.cst.TypedConstant
getBasicFrameType, getBasicType, getFrameType, isConstant
 
Methods inherited from class com.android.dx.rop.cst.Constant
compareTo, typeName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.android.dx.rop.type.TypeBearer
getType
 
Methods inherited from interface com.android.dx.util.ToHuman
toHuman
 

Method Detail

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


Copyright © 2013. All Rights Reserved.