com.android.dx.cf.code
Class ReturnAddress

java.lang.Object
  extended by com.android.dx.cf.code.ReturnAddress
All Implemented Interfaces:
TypeBearer, ToHuman

public final class ReturnAddress
extends Object
implements TypeBearer

Representation of a subroutine return address. In Java verification, somewhat counterintuitively, the salient bit of information you need to know about a return address is the start address of the subroutine being returned from, not the address being returned to, so that's what instances of this class hang onto.


Constructor Summary
ReturnAddress(int subroutineAddress)
          Constructs an instance.
 
Method Summary
 boolean equals(Object other)
          
 int getBasicFrameType()
          Gets the basic type corresponding to this instance's frame type.
 int getBasicType()
          Gets the basic type corresponding to this instance.
 TypeBearer getFrameType()
          Gets the frame type corresponding to this type.
 int getSubroutineAddress()
          Gets the subroutine address.
 Type getType()
          Gets the type associated with this instance.
 int hashCode()
          
 boolean isConstant()
          Returns whether this instance represents a constant value.
 String toHuman()
          Return the "human" string form of this instance.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReturnAddress

public ReturnAddress(int subroutineAddress)
Constructs an instance.

Parameters:
subroutineAddress - >= 0; the start address of the subroutine being returned from
Method Detail

toString

public String toString()

Overrides:
toString in class Object

toHuman

public String toHuman()
Return the "human" string form of this instance. This is generally less "debuggy" than toString().

Specified by:
toHuman in interface ToHuman
Returns:
non-null; the human string form

getType

public Type getType()
Gets the type associated with this instance.

Specified by:
getType in interface TypeBearer
Returns:
non-null; the type

getFrameType

public TypeBearer getFrameType()
Gets the frame type corresponding to this type. This method returns this, except if Type.isIntlike() on the underlying type returns true but the underlying type is not in fact Type.INT, in which case this method returns an instance whose underlying type is INT.

Specified by:
getFrameType in interface TypeBearer
Returns:
non-null; the frame type for this instance

getBasicType

public int getBasicType()
Gets the basic type corresponding to this instance.

Specified by:
getBasicType in interface TypeBearer
Returns:
the basic type; one of the BT_* constants defined by Type

getBasicFrameType

public int getBasicFrameType()
Gets the basic type corresponding to this instance's frame type. This is equivalent to getFrameType().getBasicType(), and is the same as calling getFrameType() unless this instance is an int-like type, in which case this method returns BT_INT.

Specified by:
getBasicFrameType in interface TypeBearer
Returns:
the basic frame type; one of the BT_* constants defined by Type
See Also:
TypeBearer.getBasicType(), TypeBearer.getFrameType()

isConstant

public boolean isConstant()
Returns whether this instance represents a constant value.

Specified by:
isConstant in interface TypeBearer
Returns:
true if this instance represents a constant value and false if not

equals

public boolean equals(Object other)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getSubroutineAddress

public int getSubroutineAddress()
Gets the subroutine address.

Returns:
>= 0; the subroutine address


Copyright © 2015. All rights reserved.