View Javadoc

1   /*
2    * @(#) InterpreterFactory.java Jan 14, 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.operations.reflection;
11  
12  import java.io.DataInput;
13  import java.io.IOException;
14  
15  import nl.tudelft.simulation.dsol.interpreter.Operation;
16  import nl.tudelft.simulation.dsol.interpreter.operations.InterpreterFactory;
17  
18  /***
19   * A InterpreterFactory <br>
20   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
21   * University of Technology </a>, the Netherlands. <br>
22   * See for project information <a
23   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
24   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
25   * License (GPL) </a>, no warranty <br>
26   * 
27   * @version 1.0 Jan 14, 2004 <br>
28   * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
29   *         Jacobs </a>
30   */
31  public class ReflectionFactory extends InterpreterFactory
32  {
33  	/***
34  	 * constructs a new InterpreterFactory
35  	 */
36  	public ReflectionFactory()
37  	{
38  		super();
39  	}
40  
41  
42  	/***
43  	 * @see nl.tudelft.simulation.dsol.interpreter.operations.FactoryInterface
44  	 *      #readOperation(int, java.io.DataInput, int)
45  	 */
46  	public Operation readOperation(final int operand,
47  			final DataInput dataInput, final int startBytePostion)
48  			throws IOException
49  	{
50  		switch (operand)
51  		{
52  			case INVOKEINTERFACE.OP :
53  				return new INVOKEINTERFACE(dataInput);
54  			case INVOKESPECIAL.OP :
55  				return new INVOKESPECIAL(dataInput);
56  			case INVOKESTATIC.OP :
57  				return new INVOKESTATIC(dataInput);
58  			case INVOKEVIRTUAL.OP :
59  				return new INVOKEVIRTUAL(dataInput);
60  			default :
61  				return super
62  						.readOperation(operand, dataInput, startBytePostion);
63  		}
64  	}
65  }