Skip to content

Package: AssignmentFileRestState

AssignmentFileRestState

nameinstructionbranchcomplexitylinemethod
AssignmentFileRestState(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: 40
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
finish(Buffer, String)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package scanner;
2:
3: import model.Position;
4: import symbols.AbstractSymbol;
5: import symbols.EqualSignSymbol;
6: import symbols.UnknownSymbol;
7: import basic.Buffer;
8:
9: /**
10: * This class represent the AssignmentFileSelectionState.
11: *
12: * @author HFW410
13: *
14: */
15: public class AssignmentFileRestState extends AbstractState {
16:
17:         /**
18:          * This is a the constructor for a new AssignmentFileSelectionState.
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 Begin Row of the Symbol
26:          *
27:          */
28:         public AssignmentFileRestState(final Scanner myScanner, final Integer beginningColumn,
29:                         final Integer beginningRow) {
30:                 super(myScanner, beginningColumn, beginningRow);
31:         }
32:
33:         @Override
34:         public AbstractState action(final Character character,
35:                         final Buffer<AbstractSymbol> currentResult, final String dataPath)
36:                         throws InterruptedException {
37:•                if (character == '=') {
38:                         currentResult.put(new EqualSignSymbol(new Position(this.getBeginningRow(), this
39:                                         .getBeginningColumn(), dataPath)));
40:                 } else {
41:                         currentResult.put(new UnknownSymbol(character.toString(), new Position(this
42:                                         .getBeginningRow(), this.getBeginningColumn(), dataPath)));
43:                 }
44:                 this.getMyScanner().skip();
45:                 return this.getMyScanner().getSelectionState();
46:
47:         }
48:
49:         @Override
50:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath) {
51:
52:         }
53:
54: }