Skip to content

Package: PackageDescriptionInitialState

PackageDescriptionInitialState

nameinstructionbranchcomplexitylinemethod
PackageDescriptionInitialState(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: 45
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 10
100%
M: 0 C: 1
100%
finish(Buffer, String)
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package scanner;
2:
3: import basic.Buffer;
4: import symbols.AbstractSymbol;
5:
6: /**
7: * The Selectionstate for the PackageDefinitionFileScanner.
8: *
9: * @author Lisa Leitloff
10: *
11: */
12: public class PackageDescriptionInitialState extends AbstractState {
13:
14:         /**
15:          * creates a PackageDefinitionSelectionState.
16:          *
17:          * @param myScanner
18:          * is the scanner with owns this state.
19:          * @param beginningColumn
20:          * is the first column of the Symbol.
21:          * @param beginningRow
22:          * is the first row of the Symbol.
23:          */
24:         public PackageDescriptionInitialState(final Scanner myScanner, final Integer beginningColumn,
25:                         final Integer beginningRow) {
26:                 super(myScanner, beginningColumn, beginningRow);
27:         }
28:
29:         @SuppressWarnings("deprecation")
30:         @Override
31:         public AbstractState action(final Character character,
32:                         final Buffer<AbstractSymbol> currentResult, final String dataPath)
33:                         throws InterruptedException {
34:                 final AbstractState state;
35:•                if (character.equals(ScannerConstants.COMMENTSYMBOL)) {
36:                         this.getMyScanner().skip();
37:                         state = new CommentState(this.getMyScanner(), this.getBeginningColumn(),
38:                                         this.getBeginningRow());
39:•                } else if (Character.isSpace(character)) {
40:                         state = new WhitespaceState(this.getMyScanner(), this.getBeginningColumn(),
41:                                         this.getBeginningRow());
42:                 } else {
43:                         state = new ContentState(this.getMyScanner(), this.getBeginningColumn(),
44:                                         this.getBeginningRow());
45:                 }
46:                 return state;
47:
48:         }
49:
50:         @Override
51:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath) {
52:         }
53:
54: }