package cal;

public class BasicMathsMethods {
	public static boolean isDigit(String str) {
		return str.matches("\\d+(\\.\\d+)?");
	}

	// Check if the input string is an operator
	public static boolean isOperator(String chr) {
		return chr.equals("+") || chr.equals("-") || chr.equals("*")
				|| chr.equals("/") || chr.equals("^");
	}

	// Check if the input character is an operator
	public static boolean isOperator(char chr) {
		return chr == '+' || chr == '-' || chr == '*' || chr == '/'
				|| chr == '^';
	}

	// Check if operator 2 is higher priority than operator 1
	public static boolean comparePriority(String operator1, String operator2) {
		if ((operator2.equals("+") || operator2.equals("-"))
				&& (operator1.equals("+") || operator1.equals("-")))
			return true;
		else if ((operator2.equals("*") || operator2.equals("/"))
				&& (operator1.equals("+") || operator1.equals("-")
						|| operator1.equals("*") || operator1.equals("/")))
			return true;
		else if ((operator2.equals("^"))
				&& (operator1.equals("+") || operator1.equals("-")
						|| operator1.equals("*") || operator1.equals("/")))
			return true;
		else
			return false;
	}
}

@@ -11,40 +11,221 @@
 l;%0A%0A
-public class BasicMathsMethods %7B
+/**%0A * This is a class to handle the common mathematics method.%0A */%0Apublic class BasicMathsMethods %7B%0A%09%0A%09/**%0A%09 * Checks if the string is digit.%0A%09 *%0A%09 * @param str The input string%0A%09 * @return true, if is digit%0A%09 */
 %0A%09pu
@@ -308,39 +308,45 @@
 )?%22);%0A%09%7D%0A%0A%09/
-/
+**%0A%09 *
  Check
+s
  if the 
 input string
@@ -337,27 +337,97 @@
 the 
-input string
+character is an operator.%0A%09 *%0A%09 * @param chr The input Character%0A%09 * @return true, if
  is 
-an 
 oper
@@ -423,32 +423,37 @@
  if is operator%0A
+%09 */%0A
 %09public static b
@@ -600,23 +600,29 @@
 %0A%0A%09/
-/
+**%0A%09 *
  Check
+s
  if the 
 inpu
@@ -621,29 +621,90 @@
 the 
-input character is an
+string is an operator.%0A%09 *%0A%09 * @param chr The input String%0A%09 * @return true, if is
  ope
@@ -709,16 +709,21 @@
 perator%0A
+%09 */%0A
 %09public 
@@ -851,31 +851,224 @@
 %0A%0A%09/
-/ Check if operator 2 i
+**%0A%09 * Compare the priority of the 2 operator.%0A%09 * %3Col%3E%0A%09 * %3Cli%3E%5E%0A%09 * %3Cli%3E*, /%0A%09 * %3Cli%3E+, *%0A%09 * %3C/ol%3E%0A%09 *%0A%09 * @param operator1 The 1st operator%0A%09 * @param operator2 The 2nd operator%0A%09 * @return true, if operator 1 ha
 s hi
@@ -1095,17 +1095,22 @@
 perator 
-1
+2%0A%09 */
 %0A%09public

Add javadoc to BasicMathsMethods