Skip to content

Commit bd7d423

Browse files
committed
Further code cleanup, refactoring
1 parent 8d4d8ab commit bd7d423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+8005
-233
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It's important to note that:
1818
* Various different trignometric functions with scientific constants
1919
* Utilized Dijkstra's Shunting-Yard algorithm (Reverse Polish Notation) and stacks to parse expressions
2020
* JUnit tests
21-
* Ability to run in a console window
21+
* Ability to run in a console window (no GUI)
2222

2323
##How to Run & Documentation:
2424
You can use ANT to build this project, or you can manually compile all the Java files. If you are interested in running this app through a command-line interface, run `NewtonRaphsonConsole.java`, or GUI `NewtonRaphsonApp.java`. Documentation can be found in the `/doc/` folder.

classes/InputVerification.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package classes;
2+
23
/**
34
* This class verifies the input
45
* @author Horatiu Lazu

classes/KeyMapping.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
/** This class stores the key mapping for the keyboard on the calculator.
55
* @author Horatiu Lazu
6-
* @version 1.0 */
6+
* @version 1.0
7+
*/
8+
79
public class KeyMapping{
810
/** getCommandAppending HashMap This map converts the coordinates into commands. */
911
public HashMap<String, String> getCommandAppending = new HashMap<String, String>();

classes/NewtonRaphsonApp.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,24 +232,6 @@ else if (x == 3 && y == 4){
232232
}
233233

234234
verifyCommandValidity(false);
235-
236-
/*if (!cmdBefore.equals(command)){
237-
if (command.length() >= 2 && isNumber(command.charAt(command.length()-1) + "") && isNumber(command.charAt(command.length()-2) + ""))
238-
expression = expression.substring(0, expression.length()-1) + command.substring(cmdBefore.length()) + " ";
239-
else
240-
expression = expression + command.substring(cmdBefore.length()) + " ";
241-
if (expression.endsWith("( ")){
242-
if (expression.charAt(expression.length()-4) >= '0' && expression.charAt(expression.length()-4) <= '9' || expression.charAt(expression.length()-4) == 'X')
243-
expression = expression.substring(0, expression.length()-2) + "* ( ";
244-
else
245-
expression = expression.substring(0, expression.length()-2) + " ( "; //extra space .. doesn't matter tho
246-
}
247-
248-
if (expression.length() > 3 && expression.charAt(expression.length()-3) == '^'){
249-
expression = expression.substring(0, expression.length()-3) + " ^ " + expression.charAt(expression.length()-2);
250-
}
251-
}
252-
System.out.println(expression);*/
253235
}
254236

255237
/** This helper method removes the last operation */

classes/NewtonRaphsonConsole.class

0 Bytes
Binary file not shown.

classes/NewtonRaphsonConsole.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
/** This class lets the user find the roots of an equation.
55
* @author Horatiu Lazu
6-
* @version 1.0 */
6+
* @version 1.0
7+
*/
78
public class NewtonRaphsonConsole{
89
/** Main method for the program.
910
* @param args String [] These are the arguments. */

classes/NumericalTokenizer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package classes;
2-
import java.util.*;
32

43
/**
54
* This class converts tokenizes and spaces expressions so it can be read by the parser.
65
* @author Horatiu Lazu
7-
* @version 1.0 */
6+
* @version 1.0
7+
*/
88
public class NumericalTokenizer{
99
/** operatorHelper Operations This is the operations reference. */
1010
private Operations operatorHelper = new Operations();

classes/Operation.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package classes;
2+
23
/** This class solves for the root of expressions.
34
* @author Horatiu Lazu
4-
* @version 1.0.0.0 */
5+
* @version 1.0
6+
*/
7+
58
public class Operation{
69
/** operation String This is the current operation. */
710
private static String operation = "";

classes/Operations.class

0 Bytes
Binary file not shown.

classes/Operations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @author Horatiu Lazu
66
* @version 1.0
77
*/
8+
89
public class Operations{
910
/** operator HashSet These are binary operators. */
1011
private HashSet<String> operator = new HashSet<String>();

0 commit comments

Comments
 (0)