Skip to content

Package: TypeFileRestState

TypeFileRestState

nameinstructionbranchcomplexitylinemethod
TypeFileRestState(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: 67
100%
M: 0 C: 4
100%
M: 0 C: 4
100%
M: 0 C: 14
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.ColonSignSymbol;
6: import symbols.EqualSignSymbol;
7: import symbols.PlusSymbol;
8: import symbols.UnknownSymbol;
9: import basic.Buffer;
10:
11: /**
12: * This class represents the RestState.
13: *
14: * @author HFW410
15: *
16: */
17: public class TypeFileRestState extends AbstractState {
18:         /**
19:          * This constructor initialize the RestState.
20:          *
21:          * @param myScanner
22:          * is the used Scanner.
23:          * @param beginningColumn
24:          * is the Begin Column of the Symbol
25:          * @param beginningRow
26:          * is the beginning row of the symbol
27:          */
28:         public TypeFileRestState(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:•                switch (character) {
38:                 case ':':
39:                         currentResult.put(new ColonSignSymbol(new Position(this.getBeginningRow(), this
40:                                         .getBeginningColumn(), dataPath)));
41:                         break;
42:                 case '=':
43:                         currentResult.put(new EqualSignSymbol(new Position(this.getBeginningRow(), this
44:                                         .getBeginningColumn(), dataPath)));
45:                         break;
46:                 case '+':
47:                         currentResult.put(new PlusSymbol(new Position(this.getBeginningRow(), this
48:                                         .getBeginningColumn(), dataPath)));
49:                         break;
50:                 default:
51:                         currentResult.put(new UnknownSymbol(character.toString(), new Position(this
52:                                         .getBeginningRow(), this.getBeginningColumn(), dataPath)));
53:                         break;
54:                 }
55:                 this.getMyScanner().skip();
56:                 return this.getMyScanner().getSelectionState();
57:         }
58:
59:         @Override
60:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath) {
61:
62:         }
63:
64: }