01: /**
02: *
03: */package com.dappit.Dapper.parser;
04:
05: import java.util.Iterator;
06: import java.util.Vector;
07:
08: /**
09: * @author Ohad Serfaty
10: *
11: */
12: public class InstructionsPool {
13: public Vector<Integer> operations = new Vector<Integer>();
14: public Vector<String> arguments = new Vector<String>();
15: private double currentParserVersion;
16:
17: /**
18: * reset the builder. can be reused after creating a document.
19: */
20: public void reset() {
21: operations.clear();
22: arguments.clear();
23: }
24:
25: /**
26: * Add a content sink instruction with an argument
27: *
28: * @param domOperation
29: * @param domArgument
30: */
31: public void addInstruction(int domOperation, String domArgument) {
32: this .operations.add(domOperation);
33: this .arguments.add(domArgument);
34: // System.out.println(domOperation+" " + domArgument);
35: }
36:
37: public void dump() {
38: Iterator<Integer> i2 = this .operations.iterator();
39: Iterator<String> j2 = this .arguments.iterator();
40: while (i2.hasNext())
41: System.err.println(i2.next() + " : " + j2.next());
42: }
43:
44: /**
45: * @return
46: */
47: public Vector<Integer> getInstructions() {
48: return operations;
49: }
50:
51: /**
52: * @param currentParserVersion
53: */
54: public void setParserVersion(double currentParserVersion) {
55: this.currentParserVersion = currentParserVersion;
56: }
57:
58: }
|