package runEnv; import java.util.*; import runEnv.basicValue.*; public class Multiple { /* Represents an array, or fields, methods, classes for an instance or class. */ private String name; public String name() { return name; } private Vector< RunValue > vector = new Vector< RunValue >(); public int size() { return vector.size(); } public Multiple( String name, int size ) { this.name = name; for ( int i = 0; i < size; i++ ) vector.addElement( new NullValue() ); } public Multiple( String value ) { this.name = value; for ( int i = 0; i < value.length(); i++ ) vector.addElement( new CharValue( value.charAt( i ) ) ); vector.addElement( new CharValue( '\0' ) ); } 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 vector.elementAt( i ); } public PtrValue elementAt( int i ) { return new PtrValue( this, i ); } public void setValue( int i, RunValue value ) { vector.setElementAt( value, i ); } }