Skip to content

Package: AdditionalErrorMsgState2

AdditionalErrorMsgState2

nameinstructionbranchcomplexitylinemethod
AdditionalErrorMsgState2(TempTypeExtension)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
parse(RouterSoftware, TempVariableType, Buffer, TypeFileParser)
M: 53 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: *
3: */
4: package parser.states.typestates;
5:
6: import java.util.ArrayList;
7:
8: import basic.Buffer;
9: import model.RouterSoftware;
10: import parser.ParserException;
11: import parser.TypeFileParser;
12: import parser.tempparserobjects.TempTypeExtension;
13: import parser.tempparserobjects.TempVariableType;
14: import symbols.AbstractSymbol;
15: import symbols.StringSymbol;
16:
17: /**
18: * @author Hendrik
19: *
20: */
21: public class AdditionalErrorMsgState2 extends AbstractTypeState {
22:
23:         /**
24:          * TempTypExtension.
25:          */
26:         private final TempTypeExtension tempExt;
27:
28:         /**
29:          * constructor no Side effects.
30:          *
31:          * @param tempExt
32:          * TempExt.
33:          */
34:         public AdditionalErrorMsgState2(final TempTypeExtension tempExt) {
35:                 super();
36:                 this.tempExt = tempExt;
37:         }
38:
39:         /*
40:          * (non-Javadoc)
41:          *
42:          * @see
43:          * parser.states.typestates.AbstractTypeState#parse(parser.tempparserobjects.TempVariableType,
44:          * basic.Buffer, parser.TypeFileParser)
45:          */
46:         @Override
47:         public void parse(final RouterSoftware rs, final TempVariableType tVT,
48:                         final Buffer<AbstractSymbol> buffer, final TypeFileParser tFP)
49:                         throws InterruptedException, ParserException {
50:                 final AbstractSymbol nextSymbol = buffer.remove();
51:                 this.tempExt.setMeldung(((StringSymbol) nextSymbol).getText());
52:                 this.tempExt.setReady(true);
53:
54:                 final ArrayList<TempTypeExtension> arrayList;
55:•                if (tFP.getExtensionsMap().containsKey(this.tempExt.getName())) {
56:                         arrayList = tFP.getExtensionsMap().get(this.tempExt.getName());
57:                 } else {
58:                         arrayList = new ArrayList<TempTypeExtension>();
59:                 }
60:                 arrayList.add(tempExt);
61:                 tFP.getExtensionsMap().put(this.tempExt.getName(), arrayList);
62:
63:                 tFP.setState(new TypeInitialState());
64:
65:         }
66:
67: }