Skip to content

Package: ConditionState1

ConditionState1

nameinstructionbranchcomplexitylinemethod
ConditionState1(TempTypeExtensionWithCondition)
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: 34 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: *
3: */
4: package parser.states.typestates;
5:
6: import model.RouterSoftware;
7: import parser.ParserException;
8: import parser.TypeFileParser;
9: import parser.tempparserobjects.TempTypeExtensionWithCondition;
10: import parser.tempparserobjects.TempVariableType;
11: import symbols.AbstractSymbol;
12: import symbols.StringSymbol;
13: import basic.Buffer;
14:
15: /**
16: * @author Hendrik
17: *
18: */
19: public class ConditionState1 extends AbstractTypeState {
20:
21:         /**
22:          * the tempTypExtensionVariable.
23:          */
24:         private final TempTypeExtensionWithCondition tempExt;
25:
26:         /**
27:          * The constructor.
28:          *
29:          * @param tempExt
30:          * the tempTypExtensionVariable of the line;
31:          */
32:
33:         public ConditionState1(final TempTypeExtensionWithCondition tempExt) {
34:                 super();
35:                 this.tempExt = tempExt;
36:         }
37:
38:         /*
39:          * (non-Javadoc)
40:          *
41:          * @see
42:          * parser.states.typestates.AbstractTypeState#parse(parser.tempparserobjects.TempVariableType,
43:          * basic.Buffer, parser.TypeFileParser)
44:          */
45:         @Override
46:         public void parse(final RouterSoftware rs, final TempVariableType tVT,
47:                         final Buffer<AbstractSymbol> buffer, final TypeFileParser tFP)
48:                         throws InterruptedException, ParserException {
49:                 final AbstractSymbol nextSymbol = buffer.peek();
50:•                if (nextSymbol instanceof StringSymbol) {
51:                         tFP.setState(new ConditionState2(this.tempExt));
52:                 } else {
53:                         throw new ParserException("no valid symbol: "
54:                                         + buffer.peek().getClass().getCanonicalName()
55:                                         + " expected AdditionalIdentifierSymbol");
56:                 }
57:
58:         }
59:
60: }