View Javadoc

1   /*
2    * @(#) Frame.java Jan 15, 2004
3    * 
4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  package nl.tudelft.simulation.dsol.interpreter;
11  
12  import nl.tudelft.simulation.dsol.interpreter.classfile.Constant;
13  import nl.tudelft.simulation.dsol.interpreter.classfile.MethodDescriptor;
14  
15  /***
16   * A Frame <br>
17   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
18   * University of Technology </a>, the Netherlands. <br>
19   * See for project information <a
20   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
21   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
22   * License (GPL) </a>, no warranty <br>
23   * 
24   * @version 1.0 Jan 15, 2004 <br>
25   * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
26   *         Jacobs </a>
27   */
28  public class Frame
29  {
30  	/*** the constantPool of this frame */
31  	private Constant[] constantPool = null;
32  
33  	/*** the localVariables of this frame */
34  	private LocalVariable[] localVariables = null;
35  
36  	/*** the operandStack of this frame */
37  	private OperandStack operandStack = null;
38  
39  	/*** is this frame paused */
40  	private boolean paused = false;
41  
42  	/***
43  	 * the returnPosition refers the position in the operation[] to invoke on
44  	 * return
45  	 */
46  	private int returnPosition = 0;
47  
48  	/*** the operations in the frame */
49  	private Operation[] operations = null;
50  
51  	/*** the methodDescriptor of the frame */
52  	private MethodDescriptor methodDescriptor;
53  
54  	/***
55  	 * constructs a new Frame
56  	 * 
57  	 * @param constantPool the constantPool
58  	 * @param localVariables the localVariables
59  	 * @param operations the array of operations to execute
60  	 * @param stack the stack
61  	 * @param methodDescriptor the methodDescriptor
62  	 */
63  	public Frame(final Constant[] constantPool,
64  			final LocalVariable[] localVariables, final Operation[] operations,
65  			final OperandStack stack, final MethodDescriptor methodDescriptor)
66  	{
67  		super();
68  		this.constantPool = constantPool;
69  		this.localVariables = localVariables;
70  		this.operations = operations;
71  		this.operandStack = stack;
72  		this.methodDescriptor = methodDescriptor;
73  	}
74  
75  	/***
76  	 * @return Returns the constantPool.
77  	 */
78  	public Constant[] getConstantPool()
79  	{
80  		return this.constantPool;
81  	}
82  
83  	/***
84  	 * @return Returns the localVariables.
85  	 */
86  	public LocalVariable[] getLocalVariables()
87  	{
88  		return this.localVariables;
89  	}
90  
91  	/***
92  	 * @return Returns the returnPosition.
93  	 */
94  	public int getReturnPosition()
95  	{
96  		return this.returnPosition;
97  	}
98  
99  	/***
100 	 * @return Returns the operations.
101 	 */
102 	public Operation[] getOperations()
103 	{
104 		return this.operations;
105 	}
106 
107 	/***
108 	 * @param returnPosition The returnPosition to set.
109 	 */
110 	public void setReturnPosition(final int returnPosition)
111 	{
112 		this.returnPosition = returnPosition;
113 	}
114 
115 	/***
116 	 * @return Returns the methodDescriptor.
117 	 */
118 	public MethodDescriptor getMethodDescriptor()
119 	{
120 		return this.methodDescriptor;
121 	}
122 
123 	/***
124 	 * @return Returns the operandStack.
125 	 */
126 	public OperandStack getOperandStack()
127 	{
128 		return this.operandStack;
129 	}
130 
131 	/***
132 	 * @return Returns whether the frame is paused.
133 	 */
134 	public boolean isPaused()
135 	{
136 		return this.paused;
137 	}
138 
139 	/***
140 	 * @param paused The paused to set.
141 	 */
142 	public void setPaused(final boolean paused)
143 	{
144 		this.paused = paused;
145 	}
146 }