File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ package stack ;
2
+
3
+ public class InfixCalculator {
4
+
5
+ InfixToPostfix infixToPostfix = new InfixToPostfix ();
6
+ PostCalculator postCalculator = new PostCalculator ();
7
+
8
+ public int calculate (String input ) {
9
+ return postCalculator .calculate (infixToPostfix .convertInputToPostfix (input ));
10
+ }
11
+ }
Original file line number Diff line number Diff line change 4
4
5
5
public class InfixToPostfix {
6
6
7
+ public char [] convertInputToPostfix (String input ) {
8
+ return this .convertInfixToPostfix (this .convertInputToCharArray (input ));
9
+ }
10
+
7
11
public char [] convertInputToCharArray (String input ) {
8
12
return input .replace (" " , "" ).toCharArray ();
9
13
}
Original file line number Diff line number Diff line change 1
1
package stack ;
2
2
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
3
5
import org .junit .jupiter .api .BeforeEach ;
4
6
import org .junit .jupiter .api .DisplayName ;
5
7
import org .junit .jupiter .api .Test ;
You can’t perform that action at this time.
0 commit comments