Skip to content

Package: RegExpBeginSelectionState1

RegExpBeginSelectionState1

nameinstructionbranchcomplexitylinemethod
RegExpBeginSelectionState1(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: 0 C: 35
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
finish(Buffer, String)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package scanner;
2:
3: import symbols.AbstractSymbol;
4: import basic.Buffer;
5:
6: /**
7: * This class represents the RegExpBeginSelectionState.
8: *
9: * @author HFW410
10: *
11: */
12: public class RegExpBeginSelectionState1 extends AbstractState {
13:
14:         /**
15:          * This constructor initialize the RegExpBeginSelectionState.
16:          *
17:          * @param myScanner
18:          * is the used Scanner.
19:          * @param beginningColumn
20:          * is the Begin Column of the Symbol
21:          * @param beginningRow
22:          * is the beginning row of the symbol
23:          */
24:         public RegExpBeginSelectionState1(final Scanner myScanner, final Integer beginningColumn,
25:                         final Integer beginningRow) {
26:                 super(myScanner, beginningColumn, beginningRow);
27:         }
28:
29:         @Override
30:         public AbstractState action(final Character character,
31:                         final Buffer<AbstractSymbol> currentResult, final String dataPath) {
32:•                if (character.equals(ScannerConstants.REGEXP.charAt(1))) {
33:                         this.getMyScanner().skip();
34:                         return new RegExpBeginSelectionState2(this.getMyScanner(), this.getBeginningColumn(),
35:                                         this.getMyScanner().getRowCounter());
36:                 } else {
37:                         return new IdentifierState(this.getMyScanner(), this.getBeginningColumn(),
38:                                         this.getBeginningRow(), ScannerConstants.REGEXP.substring(0, 1));
39:                 }
40:         }
41:
42:         @Override
43:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath)
44:                         throws InterruptedException {
45:                 new IdentifierState(this.getMyScanner(), this.getBeginningColumn(),
46:                                 this.getBeginningRow(), ScannerConstants.REGEXP.substring(0, 1)).finish(
47:                                 currentResult, dataPath);
48:         }
49: }