FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.type
Class TypeFrame

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.Frame<org.apache.bcel.generic.Type>
      extended by edu.umd.cs.findbugs.ba.type.TypeFrame

public class TypeFrame
extends Frame<org.apache.bcel.generic.Type>

A specialization of Frame for determining the types of values in the Java stack frame (locals and operand stack).

Author:
David Hovemeyer
See Also:
Frame, TypeAnalysis

Constructor Summary
TypeFrame(int numLocals)
          Constructor.
 
Method Summary
 void clearExactSet()
          Clear the exact type set.
 void copyFrom(Frame<org.apache.bcel.generic.Type> other_)
          Make this Frame exactly the same as the one given as a parameter.
static org.apache.bcel.generic.Type getBottomType()
          Get the single instance of the "Bottom" type.
static org.apache.bcel.generic.Type getDoubleExtraType()
          Get the single instance of the "DoubleExtra" type.
static org.apache.bcel.generic.Type getLongExtraType()
          Get the single instance of the "LongExtra" type.
static org.apache.bcel.generic.Type getNullType()
          Get the single instance of the "Null" type.
static org.apache.bcel.generic.Type getTopType()
          Get the single instance of the "Top" type.
 boolean isExact(int slot)
          Get whether or not a type in a given slot is exact.
 org.apache.bcel.generic.Type popValue()
          Pop a value off of the Java operand stack.
 void pushValue(org.apache.bcel.generic.Type value)
          Push a value onto the Java operand stack.
 void setExact(int slot, boolean isExact)
          Set whether or not a type in a given slot is exact.
 void setTop()
          Make this frame the special "TOP" value.
 java.lang.String toString()
          Convert to string.
protected  java.lang.String valueToString(org.apache.bcel.generic.Type value)
          Subclasses may override this if they want to do something special to convert Value objects to Strings.
 
Methods inherited from class edu.umd.cs.findbugs.ba.Frame
allSlots, clearStack, contains, getArgument, getArgument, getArgumentSet, getArgumentSlot, getInstance, getInstanceSlot, getInstanceStackLocation, getLastUpdateTimestamp, getNumArguments, getNumArgumentsIncludingObjectInstance, getNumLocals, getNumSlots, getOperand, getStackDepth, getStackLocation, getStackValue, getTopStackWords, getTopValue, getValue, isBottom, isTop, isValid, sameAs, setBottom, setLastUpdateTimestamp, setValid, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeFrame

public TypeFrame(int numLocals)
Constructor.

Method Detail

setExact

public void setExact(int slot,
                     boolean isExact)
Set whether or not a type in a given slot is exact.

Parameters:
slot - the slot
isExact - true if the slot contains an exact type, false if just an upper bound

isExact

public boolean isExact(int slot)
Get whether or not a type in a given slot is exact.

Parameters:
slot - the slot
Returns:
true if the slot contains an exact type, false if just an upper bound

clearExactSet

public void clearExactSet()
Clear the exact type set. The result is that all slots will be assumed not to contain an exact type.


setTop

public void setTop()
Description copied from class: Frame
Make this frame the special "TOP" value. Such Frames are the identity element of the meet operation.

Overrides:
setTop in class Frame<org.apache.bcel.generic.Type>

copyFrom

public void copyFrom(Frame<org.apache.bcel.generic.Type> other_)
Description copied from class: Frame
Make this Frame exactly the same as the one given as a parameter.

Overrides:
copyFrom in class Frame<org.apache.bcel.generic.Type>
Parameters:
other_ - the Frame to make this object the same as

valueToString

protected java.lang.String valueToString(org.apache.bcel.generic.Type value)
Description copied from class: Frame
Subclasses may override this if they want to do something special to convert Value objects to Strings. By default, we just call toString() on the values.

Overrides:
valueToString in class Frame<org.apache.bcel.generic.Type>

getTopType

public static org.apache.bcel.generic.Type getTopType()
Get the single instance of the "Top" type.


getBottomType

public static org.apache.bcel.generic.Type getBottomType()
Get the single instance of the "Bottom" type.


getLongExtraType

public static org.apache.bcel.generic.Type getLongExtraType()
Get the single instance of the "LongExtra" type.


getDoubleExtraType

public static org.apache.bcel.generic.Type getDoubleExtraType()
Get the single instance of the "DoubleExtra" type.


getNullType

public static org.apache.bcel.generic.Type getNullType()
Get the single instance of the "Null" type.


pushValue

public void pushValue(org.apache.bcel.generic.Type value)
Description copied from class: Frame
Push a value onto the Java operand stack.

Overrides:
pushValue in class Frame<org.apache.bcel.generic.Type>
Parameters:
value - the ValueType to push

popValue

public org.apache.bcel.generic.Type popValue()
                                      throws DataflowAnalysisException
Pop a value off of the Java operand stack.

Overrides:
popValue in class Frame<org.apache.bcel.generic.Type>
Returns:
the value that was popped
Throws:
DataflowAnalysisException - if the Java operand stack is empty

toString

public java.lang.String toString()
Description copied from class: Frame
Convert to string.

Overrides:
toString in class Frame<org.apache.bcel.generic.Type>

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.