Skip to content

Package: AbstractState

AbstractState

nameinstructionbranchcomplexitylinemethod
AbstractState(Scanner, Integer, Integer)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getBeginningColumn()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getBeginningRow()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getMyScanner()
M: 0 C: 3
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 symbols.AbstractSymbol;
4: import basic.Buffer;
5:
6: /**
7: * This class represents the states as abstract class.
8: *
9: * @author HFW410
10: *
11: */
12: public abstract class AbstractState {
13:         /**
14:          * This attribute represent a relationship to the Scanner.
15:          */
16:         private final Scanner myScanner;
17:         /**
18:          * represents the begincolumn of the character.
19:          */
20:         private final Integer beginningColumn;
21:
22:         /**
23:          * represents the beginRow of the character.
24:          */
25:         private final Integer beginningRow;
26:
27:         /**
28:          * This constructor create a new State.
29:          *
30:          * @param myScanner
31:          * is the used scanner.
32:          * @param beginningColumn
33:          * is the Begin Column of the Symbol
34:          * @param beginningRow
35:          * is the begin row of the symbol
36:          *
37:          */
38:         public AbstractState(final Scanner myScanner, final Integer beginningColumn,
39:                         final Integer beginningRow) {
40:                 super();
41:                 this.myScanner = myScanner;
42:                 this.beginningColumn = beginningColumn;
43:                 this.beginningRow = beginningRow;
44:         }
45:
46:         /**
47:          * This method represents the action which will be executed, if it reached.
48:          *
49:          * @param character
50:          * is the used Character.
51:          * @param currentResult
52:          * is the Buffer of symbols.
53:          * @param dataPath
54:          * is the path to the dataStream
55:          * @throws InterruptedException
56:          * for a Interruption in the method
57:          * @return the actual state of the scanner.
58:          */
59:         public abstract AbstractState action(Character character,
60:                         Buffer<AbstractSymbol> currentResult, String dataPath) throws InterruptedException;
61:
62:         /**
63:          *
64:          * @return the used scanner.
65:          */
66:         public Scanner getMyScanner() {
67:                 return this.myScanner;
68:         }
69:
70:         /**
71:          *
72:          * @return the begincolumn of the Chracter in the stream.
73:          */
74:         public Integer getBeginningColumn() {
75:                 return this.beginningColumn;
76:         }
77:
78:         /**
79:          *
80:          * @return the beginning row.
81:          */
82:         public Integer getBeginningRow() {
83:                 return this.beginningRow;
84:         }
85:
86:         /**
87:          * Method, which will be call at the end of each row.
88:          *
89:          * @param currentResult
90:          * is the buffer of symbols.
91:          * @param dataPath
92:          * is the path.
93:          * @throws InterruptedException
94:          * from the Buffer.
95:          */
96:         protected abstract void finish(Buffer<AbstractSymbol> currentResult, String dataPath)
97:                         throws InterruptedException;
98:
99: }