package runEnv; import runEnv.basicValue.*; import java.util.*; public class Multiple { /* Represents an array, or fields, for an instance or activation record for a method. */ private Vector< RunValue > vector = new Vector< RunValue >(); public int size() { return vector.size(); } public Multiple( int size ) { for ( int i = 0; i < size; i++ ) vector.addElement( new NullValue() ); } public String toString() { String result = ""; if ( size() == 0 ) return "{}"; for ( int i = 0; i < size(); i++ ) { if ( i > 0 ) result += ", "; result += getValue( i ); } return "{ " + result + " }"; } public RunValue getValue( int i ) { return ( RunValue ) vector.elementAt( i ); } public RunAddress getAddress( int i ) { return new RunAddress( this, i ); } public void setValue( int i, RunValue value ) { vector.setElementAt( value, i ); } }