Package com.android.dx.rop.cst
Class CstLiteralBits
java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
com.android.dx.rop.cst.CstLiteralBits
- All Implemented Interfaces:
TypeBearer
,ToHuman
,Comparable<Constant>
- Direct Known Subclasses:
CstKnownNull
,CstLiteral32
,CstLiteral64
Constants which are literal bitwise values of some sort.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this value can fit in 16 bits with sign-extension.boolean
Returns true if this value can fit in 8 bits with sign-extension.abstract boolean
Returns whether or not this instance's value may be accurately represented as anint
.abstract int
Gets the value asint
bits.abstract long
Gets the value aslong
bits.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, compareTo0, isCategory2, typeName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.android.dx.rop.type.TypeBearer
getType
-
Constructor Details
-
CstLiteralBits
public CstLiteralBits()
-
-
Method Details
-
fitsInInt
public abstract boolean fitsInInt()Returns whether or not this instance's value may be accurately represented as anint
. The rule is that if there is anint
which may be sign-extended to yield this instance's value, then this method returnstrue
. Otherwise, it returnsfalse
.- Returns:
true
iff this instance fits in anint
-
getIntBits
public abstract int getIntBits()Gets the value asint
bits. If this instance contains more bits than fit in anint
, then this returns only the low-order bits.- Returns:
- the bits
-
getLongBits
public abstract long getLongBits()Gets the value aslong
bits. If this instance contains fewer bits than fit in along
, then the result of this method is the sign extension of the value.- Returns:
- the bits
-
fitsIn16Bits
public boolean fitsIn16Bits()Returns true if this value can fit in 16 bits with sign-extension.- Returns:
- true if the sign-extended lower 16 bits are the same as the value.
-
fitsIn8Bits
public boolean fitsIn8Bits()Returns true if this value can fit in 8 bits with sign-extension.- Returns:
- true if the sign-extended lower 8 bits are the same as the value.
-