Skip to content

Package: ConditionBeginState

ConditionBeginState

nameinstructionbranchcomplexitylinemethod
ConditionBeginState(Scanner, Integer, Integer)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
action(Character, Buffer, String)
M: 14 C: 22
61%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
finish(Buffer, String)
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /**
2: *
3: */
4: package scanner;
5:
6: import model.Position;
7: import symbols.AbstractSymbol;
8: import symbols.EqualsTildeSymbol;
9: import symbols.UnknownSymbol;
10: import basic.Buffer;
11:
12: /**
13: * @author Hendrik
14: *
15: */
16: public class ConditionBeginState extends AbstractState {
17:         /**
18:          * This constructor initialize the new ConditionBeginState.
19:          *
20:          * @param myScanner
21:          * is the used scanner.
22:          * @param beginningColumn
23:          * is the Begin Column of the Symbol
24:          * @param beginningRow
25:          * is the beginning row of the symbol
26:          */
27:         public ConditionBeginState(final Scanner myScanner, final Integer beginningColumn,
28:                         final Integer beginningRow) {
29:                 super(myScanner, beginningColumn, beginningRow);
30:         }
31:
32:         /*
33:          * (non-Javadoc)
34:          *
35:          * @see scanner.AbstractState#action(java.lang.Character, basic.Buffer, java.lang.String)
36:          */
37:         @Override
38:         public AbstractState action(final Character character,
39:                         final Buffer<AbstractSymbol> currentResult, final String dataPath)
40:                         throws InterruptedException {
41:•                if (character.equals(ScannerConstants.TILDE)) {
42:                         finish(currentResult, dataPath);
43:                 } else {
44:                         currentResult.put(new UnknownSymbol("Wrong Symbol behind the =", new Position(
45:                                         getBeginningRow(), getBeginningColumn(), dataPath)));
46:                 }
47:                 this.getMyScanner().skip();
48:                 return new ConditionState1(getMyScanner(), getBeginningColumn(), getBeginningRow());
49:         }
50:
51:         /*
52:          * (non-Javadoc)
53:          *
54:          * @see scanner.AbstractState#finish(basic.Buffer, java.lang.String)
55:          */
56:         @Override
57:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath)
58:                         throws InterruptedException {
59:                 currentResult.put(new EqualsTildeSymbol(new Position(this.getBeginningRow(), this
60:                                 .getBeginningColumn(), dataPath)));
61:
62:         }
63:
64: }