nl.tudelft.simulation.dsol.interpreter
Class LocalVariable

java.lang.Object
  extended by nl.tudelft.simulation.dsol.interpreter.LocalVariable
All Implemented Interfaces:
Cloneable

public class LocalVariable
extends Object
implements Cloneable

Each frame (�3.6) contains an array of variables known as its local variables. The length of the local variable array of a frame is determined at compile time and supplied in the binary representation of a class or interface along with the code for the method associated with the frame (�4.7.3). A single local variable can hold a value of type boolean, byte, char, short, int, float, reference, or returnAddress. A pair of local variables can hold a value of type long or double.

Local variables are addressed by indexing. The index of the first local variable is zero. An integer is be considered to be an index into the local variable array if and only if that integer is between zero and one less than the size of the local variable array.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:12 $
Author:
Peter Jacobs

Constructor Summary
LocalVariable(LocalVariableDescriptor localVariableDescriptor)
          constructs a new LocalVariable
 
Method Summary
 Object clone()
           
 LocalVariableDescriptor getLocalVariableDescriptor()
           
 Object getValue()
           
static LocalVariable[] newInstance(LocalVariableDescriptor[] descriptors)
          creates a new array of local variables
static void replace(LocalVariable[] localVariables, Object oldValue, Object newValue)
          replaces the value of a localVarialbe
 void setValue(Object value)
           
 String toString()
           
static String toString(LocalVariable[] localVariables)
          parses the localVariables to string
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalVariable

public LocalVariable(LocalVariableDescriptor localVariableDescriptor)
constructs a new LocalVariable

Parameters:
localVariableDescriptor - the descriptor
Method Detail

getLocalVariableDescriptor

public LocalVariableDescriptor getLocalVariableDescriptor()
Returns:
Returns the localVariableDescriptor.

getValue

public Object getValue()
Returns:
Returns the value.

setValue

public void setValue(Object value)
Parameters:
value - The value to set.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

newInstance

public static LocalVariable[] newInstance(LocalVariableDescriptor[] descriptors)
creates a new array of local variables

Parameters:
descriptors - the descriptors
Returns:
LocalVariable[]

replace

public static void replace(LocalVariable[] localVariables,
                           Object oldValue,
                           Object newValue)
replaces the value of a localVarialbe

Parameters:
localVariables - the set to introspect
oldValue - the oldValue
newValue - the new value

toString

public static String toString(LocalVariable[] localVariables)
parses the localVariables to string

Parameters:
localVariables - the localVariables
Returns:
String the result

clone

public Object clone()
Overrides:
clone in class Object
See Also:
Object.clone()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.