View Javadoc

1   /*
2    * @(#) FactoryInterface.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;
11  
12  import java.io.DataInput;
13  import java.io.IOException;
14  
15  import nl.tudelft.simulation.dsol.interpreter.Operation;
16  
17  /***
18   * The factoryInterface defines the required behavior for operation factories
19   * mapping opcodes to operations.
20   * <p>
21   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
22   * University of Technology </a>, the Netherlands. <br>
23   * See for project information <a
24   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
25   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
26   * License (GPL) </a>, no warranty <br>
27   * 
28   * @author <a href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
29   *         Jacobs </a>
30   * @version 1.2 Apr 6, 2004
31   * @since 1.4
32   */
33  public interface FactoryInterface
34  {
35  	/*** RESERVED OPCODE */
36  	int BREAKPOINT = 202;
37  
38  	/*** RESERVED OPCODE */
39  	int IMPDEP1 = 254;
40  
41  	/*** RESERVED OPCODE */
42  	int IMPDEP2 = 255;
43  
44  	/***
45  	 * resolves an operation for an operandCode
46  	 * 
47  	 * @param dataInput the dataInput
48  	 * @param startBytePosition the position in the byteStream
49  	 * @return Operation the operation
50  	 * @throws IOException on IOException
51  	 */
52  	Operation readOperation(final DataInput dataInput,
53  			final int startBytePosition) throws IOException;
54  
55  	/***
56  	 * resolves an operation for an operandCode
57  	 * 
58  	 * @param operand the operand
59  	 * @param dataInput the dataInput
60  	 * @param startBytePosition the position in the byteStream
61  	 * @return Operation the operation
62  	 * @throws IOException on IOException
63  	 */
64  	Operation readOperation(final int operand, final DataInput dataInput,
65  			final int startBytePosition) throws IOException;
66  }