Java Doc for Frame.java in  » Code-Analyzer » findbugs » edu » umd » cs » findbugs » ba » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » findbugs » edu.umd.cs.findbugs.ba 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.umd.cs.findbugs.ba.Frame

Frame
abstract public class Frame (Code)
Generic class for representing a Java stack frame as a dataflow value. A frame consists of "slots", which represent the local variables and values on the Java operand stack. Slots 0 .. getNumLocals() - 1 represent the local variables. Slots getNumLocals() .. getNumSlots() - 1 represent the Java operand stack.

Frame is parametized by "ValueType", which is the type of value to be stored in the Frame's slots. This type must form a lattice, according to the abstract mergeValues() operation in the corresponding analysis class (which should be derived from FrameDataflowAnalysis). When a Frame is constructed, all of its slots will contain null. The analysis is responsible for initializing created Frames with default values at the appropriate time. Typically, only initEntryFact() will need to do this.

A Frame may have the special "TOP" value. Such frames serve as the identity element for the meet operation operation.

A Frame may have the special "BOTTOM" value. The result of merging any frame with BOTTOM is BOTTOM.
author:
   David Hovemeyer
See Also:   FrameDataflowAnalysis




Constructor Summary
public  Frame(int numLocals)
     Constructor.

Method Summary
public  Collection<ValueType>allSlots()
    
public  voidclearStack()
     Clear the Java operand stack.
public  voidcopyFrom(Frame<ValueType> other)
     Make this Frame exactly the same as the one given as a parameter.
public  ValueTypegetArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments)
     Get the ith argument passed to given method invocation.
public  ValueTypegetArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, SignatureParser sigParser)
     Get the ith argument passed to given method invocation.
Parameters:
  ins - the method invocation instruction
Parameters:
  cpg - the ConstantPoolGen for the class containing the method
Parameters:
  i - index of the argument; 0 for the first argument, etc.
public  BitSetgetArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser)
     Get set of arguments passed to a method invocation which match given predicate.
public  intgetArgumentSlot(int i, int numArguments)
     Get the stack slot that will contain given method argument.
public  ValueTypegetInstance(Instruction ins, ConstantPoolGen cpg)
     Get the value corresponding to the object instance used in the given instruction.
public  intgetInstanceSlot(Instruction ins, ConstantPoolGen cpg)
     Get the slot the object instance referred to by given instruction is located in.
public  intgetInstanceStackLocation(Instruction ins, ConstantPoolGen cpg)
     Get the stack location (counting down from top of stack, starting at 0) containing the object instance referred to by given instruction.
public  intgetLastUpdateTimestamp()
    
public  intgetNumArguments(InvokeInstruction ins, ConstantPoolGen cpg)
     Get the number of arguments passed to given method invocation.
public  intgetNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg)
     Get the number of arguments passed to given method invocation, including the object instance if the call is to an instance method.
public  intgetNumLocals()
     Get the number of locals.
public  intgetNumSlots()
     Get the number of slots (locals plus stack values).
public  ValueTypegetOperand(StackConsumer ins, ConstantPoolGen cpg, int i)
     Get the ith operand used by given instruction.
Parameters:
  ins - the instruction, which must be a StackConsumer
Parameters:
  cpg - the ConstantPoolGen
Parameters:
  i - index of operand to get: 0 for the first operand, etc.
public  intgetStackDepth()
     Get the depth of the Java operand stack.
public  intgetStackLocation(int loc)
     Get a the location in the frame of a value on the operand stack.
public  ValueTypegetStackValue(int loc)
     Get a value on the operand stack.
public  voidgetTopStackWords(ValueType[] valueList)
     Get the values on the top of the Java operand stack.
public  ValueTypegetTopValue()
     Get the value on the top of the Java operand stack.
public  ValueTypegetValue(int n)
     Get the value at the nth slot.
public  booleanisBottom()
     Return whether or not this object is the special "BOTTOM" value for Frames.
public  booleanisTop()
     Return whether or not this object the special "TOP" value for Frames.
public  booleanisValid()
    
public  ValueTypepopValue()
     Pop a value off of the Java operand stack.
public  voidpushValue(ValueType value)
     Push a value onto the Java operand stack.
public  booleansameAs(Frame<ValueType> other)
     Return true if this stack frame is the same as the one given as a parameter.
public  voidsetBottom()
     Make this Frame the special "BOTTOM" value.
public  voidsetLastUpdateTimestamp(int lastUpdateTimestamp)
    
public  voidsetTop()
     Make this frame the special "TOP" value.
public  voidsetValid()
     Set the Frame to be valid (neither TOP nor BOTTOM).
public  voidsetValue(int n, ValueType value)
     Set the value at the nth slot.
public  StringtoString()
     Convert to string.
protected  StringvalueToString(ValueType value)
     Subclasses may override this if they want to do something special to convert Value objects to Strings.


Constructor Detail
Frame
public Frame(int numLocals)(Code)
Constructor. This version of the constructor is for subclasses for which it is always safe to call getDefaultValue(), even when the object is not fully initialized.
Parameters:
  numLocals - number of local variable slots in the method




Method Detail
allSlots
public Collection<ValueType> allSlots()(Code)
an unmodifiable Collection of the local variable and operand stack slots



clearStack
public void clearStack()(Code)
Clear the Java operand stack. Only local variable slots will remain in the frame.



copyFrom
public void copyFrom(Frame<ValueType> other)(Code)
Make this Frame exactly the same as the one given as a parameter.
Parameters:
  other - the Frame to make this object the same as



getArgument
public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments) throws DataflowAnalysisException(Code)
Get the ith argument passed to given method invocation.
Parameters:
  ins - the method invocation instruction
Parameters:
  cpg - the ConstantPoolGen for the class containing the method
Parameters:
  i - index of the argument; 0 for the first argument, etc.
Parameters:
  numArguments - total number of arguments to the method the ith argument
throws:
  DataflowAnalysisException -



getArgument
public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, SignatureParser sigParser) throws DataflowAnalysisException(Code)
Get the ith argument passed to given method invocation.
Parameters:
  ins - the method invocation instruction
Parameters:
  cpg - the ConstantPoolGen for the class containing the method
Parameters:
  i - index of the argument; 0 for the first argument, etc. the ith argument
throws:
  DataflowAnalysisException -



getArgumentSet
public BitSet getArgumentSet(InvokeInstruction invokeInstruction, ConstantPoolGen cpg, DataflowValueChooser<ValueType> chooser) throws DataflowAnalysisException(Code)
Get set of arguments passed to a method invocation which match given predicate.
Parameters:
  invokeInstruction - the InvokeInstruction
Parameters:
  cpg - the ConstantPoolGen
Parameters:
  chooser - predicate to choose which argument values should be in thereturned set BitSet specifying which arguments match the predicate, indexed byargument number (starting from 0)
throws:
  DataflowAnalysisException -



getArgumentSlot
public int getArgumentSlot(int i, int numArguments)(Code)
Get the stack slot that will contain given method argument. Assumes that this frame is at the location (just before) a method invocation instruction.
Parameters:
  i - the argument index: 0 for first arg, etc.
Parameters:
  numArguments - total number of arguments to the called method slot containing the argument value



getInstance
public ValueType getInstance(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException(Code)
Get the value corresponding to the object instance used in the given instruction. This relies on the observation that in instructions which use an object instance (such as getfield, invokevirtual, etc.), the object instance is the first operand used by the instruction.
Parameters:
  ins - the instruction
Parameters:
  cpg - the ConstantPoolGen for the method



getInstanceSlot
public int getInstanceSlot(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException(Code)
Get the slot the object instance referred to by given instruction is located in.
Parameters:
  ins - the Instruction
Parameters:
  cpg - the ConstantPoolGen for the method stack slot the object instance is in
throws:
  DataflowAnalysisException -



getInstanceStackLocation
public int getInstanceStackLocation(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException(Code)
Get the stack location (counting down from top of stack, starting at 0) containing the object instance referred to by given instruction. This relies on the observation that in instructions which use an object instance (such as getfield, invokevirtual, etc.), the object instance is the first operand used by the instruction.

The value returned may be passed to getStackValue(int).


Parameters:
  ins - the Instruction
Parameters:
  cpg - the ConstantPoolGen for the method stack location (counting down from top of stack, starting at 0)containing the object instance
throws:
  DataflowAnalysisException -



getLastUpdateTimestamp
public int getLastUpdateTimestamp()(Code)
Returns the lastUpdateTimestamp.



getNumArguments
public int getNumArguments(InvokeInstruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException(Code)
Get the number of arguments passed to given method invocation.
Parameters:
  ins - the method invocation instruction
Parameters:
  cpg - the ConstantPoolGen for the class containing the method number of arguments; note that this excludes the object instancefor instance methods
throws:
  DataflowAnalysisException -



getNumArgumentsIncludingObjectInstance
public int getNumArgumentsIncludingObjectInstance(InvokeInstruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException(Code)
Get the number of arguments passed to given method invocation, including the object instance if the call is to an instance method.
Parameters:
  ins - the method invocation instruction
Parameters:
  cpg - the ConstantPoolGen for the class containing the method number of arguments, including object instance if appropriate
throws:
  DataflowAnalysisException -



getNumLocals
public int getNumLocals()(Code)
Get the number of locals.



getNumSlots
public int getNumSlots()(Code)
Get the number of slots (locals plus stack values).



getOperand
public ValueType getOperand(StackConsumer ins, ConstantPoolGen cpg, int i) throws DataflowAnalysisException(Code)
Get the ith operand used by given instruction.
Parameters:
  ins - the instruction, which must be a StackConsumer
Parameters:
  cpg - the ConstantPoolGen
Parameters:
  i - index of operand to get: 0 for the first operand, etc. the ith operand used by the given instruction
throws:
  DataflowAnalysisException -



getStackDepth
public int getStackDepth()(Code)
Get the depth of the Java operand stack.



getStackLocation
public int getStackLocation(int loc) throws DataflowAnalysisException(Code)
Get a the location in the frame of a value on the operand stack.
Parameters:
  loc - the stack location, counting downwards from the top (location0)



getStackValue
public ValueType getStackValue(int loc) throws DataflowAnalysisException(Code)
Get a value on the operand stack.
Parameters:
  loc - the stack location, counting downwards from the top (location0)



getTopStackWords
public void getTopStackWords(ValueType[] valueList) throws DataflowAnalysisException(Code)
Get the values on the top of the Java operand stack. The top stack item is placed at the end of the array, so that to restore the values to the stack, you would push them in the order they appear in the array.



getTopValue
public ValueType getTopValue() throws DataflowAnalysisException(Code)
Get the value on the top of the Java operand stack.
throws:
  DataflowAnalysisException - if the Java operand stack is empty



getValue
public ValueType getValue(int n)(Code)
Get the value at the nth slot.
Parameters:
  n - the slot to get the value of the value in the slot



isBottom
public boolean isBottom()(Code)
Return whether or not this object is the special "BOTTOM" value for Frames. Such Frames arise when merging two frames of different size.



isTop
public boolean isTop()(Code)
Return whether or not this object the special "TOP" value for Frames. Such Frames are the identity element of the meet operation.



isValid
public boolean isValid()(Code)
Is the frame valid (meaning it is not TOP or BOTTOM)?



popValue
public ValueType popValue() throws DataflowAnalysisException(Code)
Pop a value off of the Java operand stack. the value that was popped
throws:
  DataflowAnalysisException - if the Java operand stack is empty



pushValue
public void pushValue(ValueType value)(Code)
Push a value onto the Java operand stack.
Parameters:
  value - the ValueType to push



sameAs
public boolean sameAs(Frame<ValueType> other)(Code)
Return true if this stack frame is the same as the one given as a parameter.
Parameters:
  other - the other Frame true if the frames are the same, false otherwise



setBottom
public void setBottom()(Code)
Make this Frame the special "BOTTOM" value. Such Frames arise when merging two frames of different size.



setLastUpdateTimestamp
public void setLastUpdateTimestamp(int lastUpdateTimestamp)(Code)

Parameters:
  lastUpdateTimestamp - The lastUpdateTimestamp to set.



setTop
public void setTop()(Code)
Make this frame the special "TOP" value. Such Frames are the identity element of the meet operation.



setValid
public void setValid()(Code)
Set the Frame to be valid (neither TOP nor BOTTOM).



setValue
public void setValue(int n, ValueType value)(Code)
Set the value at the nth slot.
Parameters:
  n - the slot in which to set a new value
Parameters:
  value - the value to set



toString
public String toString()(Code)
Convert to string.



valueToString
protected String valueToString(ValueType value)(Code)
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.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.