|
|
@@ -0,0 +1,598 @@
|
|
|
+package com.lc.ibps.components.verification.funcs;
|
|
|
+
|
|
|
+import java.io.Serializable;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+
|
|
|
+public class xValue implements Serializable {
|
|
|
+ private static final byte iNULL = 0;
|
|
|
+ private static final byte iDOUBLE = 1;
|
|
|
+ private static final byte iSTRING = 2;
|
|
|
+ private static final byte iBOOLEAN = 3;
|
|
|
+ private static final byte iREF = 4;
|
|
|
+ private static final byte iOBJECT = 5;
|
|
|
+ private static final byte iNOERR = 6; //From this point up are Errors
|
|
|
+ private static final byte iERRDIV = 7;
|
|
|
+ private static final byte iERRNA = 8;
|
|
|
+ private static final byte iERRNAME = 9;
|
|
|
+ private static final byte iERRNULL = 10;
|
|
|
+ private static final byte iERRNUM = 11;
|
|
|
+ private static final byte iERRREF = 12;
|
|
|
+ private static final byte iERRVALUE = 13;
|
|
|
+ private static final byte iERRGEN = 14;
|
|
|
+
|
|
|
+ private static final String sERRDIV = "#DIV/0!";
|
|
|
+ private static final String sERRNA = "#N/A";
|
|
|
+ private static final String sERRNAME = "#NAME?";
|
|
|
+ private static final String sERRNULL = "#NULL!";
|
|
|
+ private static final String sERRNUM = "#NUM!";
|
|
|
+ private static final String sERRREF = "#REF!";
|
|
|
+ private static final String sERRVALUE = "#VALUE!";
|
|
|
+
|
|
|
+ /** @deprecated - this attribute is OBFUSCATED for clients. Replace the start of this line for developer javadocs. */
|
|
|
+ public static final String sERRGEN = "#ERROR!";
|
|
|
+
|
|
|
+ //Attributes
|
|
|
+ private byte iType = iNULL;
|
|
|
+ private double valDoub;
|
|
|
+ private Object valObj = null; //Originally this was a String declaration
|
|
|
+
|
|
|
+ //============SET METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the attributes of valX
|
|
|
+ * @param valX the value to store
|
|
|
+ */
|
|
|
+ public void setVal(xValue valX) {
|
|
|
+ iType = valX.iType;
|
|
|
+ if (!isErr()) {
|
|
|
+ if ((iType == iDOUBLE) || (iType == iBOOLEAN)) {
|
|
|
+ valDoub = valX.valDoub;
|
|
|
+ } else {
|
|
|
+ valObj = valX.valObj;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the double, valD
|
|
|
+ * @param valD the double to store
|
|
|
+ */
|
|
|
+ public void setVal(double valD) {
|
|
|
+ if (Double.isNaN(valD)) {
|
|
|
+ iType = iERRNUM;
|
|
|
+ } else {
|
|
|
+ iType = iDOUBLE;
|
|
|
+ valDoub = valD;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the boolean, valB
|
|
|
+ * @param valB the boolean to store
|
|
|
+ */
|
|
|
+ public void setVal(boolean valB) {
|
|
|
+ iType = iBOOLEAN;
|
|
|
+ valDoub = (valB ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the String, valS
|
|
|
+ * @param valS the String to store
|
|
|
+ */
|
|
|
+ public void setVal(String valS) {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the Object, valO
|
|
|
+ * @param valO the Object to store
|
|
|
+ */
|
|
|
+ public void setVal(Object valO) {
|
|
|
+ iType = iOBJECT;
|
|
|
+ valObj = valO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Formats and stores a String in the xValue.
|
|
|
+ * If valS can be converted into a double, date or boolean,
|
|
|
+ * it is stored as such, with all non-numeric symbols removed.
|
|
|
+ * @param valS the String to format and store
|
|
|
+ */
|
|
|
+ public void setValFormat(String valS) {
|
|
|
+ setValFormat(valS, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Formats and stores a String in the xValue.
|
|
|
+ * If valS can be converted into a double, date or boolean,
|
|
|
+ * it is stored as such, with all non-numeric symbols removed.
|
|
|
+ * @param valS the String to format and store
|
|
|
+ * @param bNull if TRUE, empty strings are set to null
|
|
|
+ */
|
|
|
+ public void setValFormat(String valS, boolean bNull) {
|
|
|
+ //****Needs Work****
|
|
|
+ try {
|
|
|
+ if (valS.lastIndexOf("'") >= 0) {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ } else if (valS.length() == 0) {
|
|
|
+ if (bNull) {
|
|
|
+ iType = iNULL;
|
|
|
+ valObj = null;
|
|
|
+ } else {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ if (valS.indexOf("/") == -1) {
|
|
|
+ valDoub = getDoubFromStr(valS);
|
|
|
+ }
|
|
|
+ iType = iDOUBLE;
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ if (valS.compareToIgnoreCase("TRUE") == 0) {
|
|
|
+ iType = iBOOLEAN;
|
|
|
+ valDoub = 1;
|
|
|
+ } else if (valS.compareToIgnoreCase("FALSE") == 0) {
|
|
|
+ iType = iBOOLEAN;
|
|
|
+ valDoub = 0;
|
|
|
+ } else if (valS.charAt(0) == '#') {
|
|
|
+ if (valS.equalsIgnoreCase(sERRNA)) {
|
|
|
+ iType = iERRNA;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRDIV)) {
|
|
|
+ iType = iERRDIV;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRNAME)) {
|
|
|
+ iType = iERRNAME;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRNULL)) {
|
|
|
+ iType = iERRNULL;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRNUM)) {
|
|
|
+ iType = iERRNUM;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRREF)) {
|
|
|
+ iType = iERRREF;
|
|
|
+ } else if (valS.equalsIgnoreCase(sERRVALUE)) {
|
|
|
+ iType = iERRVALUE;
|
|
|
+ } else {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ iType = iSTRING;
|
|
|
+ valObj = valS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //============GET METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the double equivalent of current object.
|
|
|
+ * If object can be converted into a double, it is returned as such,
|
|
|
+ * with all non-numeric symbols removed.
|
|
|
+ * @return the double equivalent
|
|
|
+ */
|
|
|
+ public double getDoub() {
|
|
|
+ //****Needs Work****
|
|
|
+ if ((iType == iDOUBLE) || (iType == iBOOLEAN)) {
|
|
|
+ return valDoub;
|
|
|
+ } else if (iType == iSTRING) {
|
|
|
+ String sBuff = (String) valObj;
|
|
|
+ if (sBuff.length() == 0) {
|
|
|
+ return 0;
|
|
|
+ } else {
|
|
|
+ return getDoubFromStr(sBuff);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the boolean equivalent of current object.
|
|
|
+ * If object can be converted into a boolean, it is returned as such.
|
|
|
+ * @return the boolean equivalent
|
|
|
+ */
|
|
|
+ public boolean getBool() {
|
|
|
+ if ((iType == iDOUBLE) || (iType == iBOOLEAN)) {
|
|
|
+ return (valDoub != 0);
|
|
|
+ } else if (iType == iSTRING) {
|
|
|
+ String sBuff = (String) valObj;
|
|
|
+ if (sBuff.length() == 0) {
|
|
|
+ return false;
|
|
|
+ } else if (sBuff.compareToIgnoreCase("TRUE") == 0 || sBuff.compareToIgnoreCase("'TRUE") == 0) {
|
|
|
+ return true;
|
|
|
+ } else if (sBuff.compareToIgnoreCase("FALSE") == 0 || sBuff.compareToIgnoreCase("'FALSE") == 0) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ throw new NumberFormatException();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the String representation of current object.
|
|
|
+ * @return the String equivalent
|
|
|
+ */
|
|
|
+ public String getStr() {
|
|
|
+ if (iType == iDOUBLE) {
|
|
|
+ String sTemp;
|
|
|
+ if (Math.round(valDoub) == valDoub) {
|
|
|
+ Double dNum = new Double(valDoub);
|
|
|
+ sTemp = Long.toString(dNum.longValue());
|
|
|
+ dNum = null;
|
|
|
+ } else {
|
|
|
+ DecimalFormat df = new DecimalFormat("#.###############");
|
|
|
+ sTemp = df.format(valDoub);
|
|
|
+ }
|
|
|
+ return sTemp;
|
|
|
+ } else if (iType == iBOOLEAN) {
|
|
|
+ if (valDoub != 0) {
|
|
|
+ return "TRUE";
|
|
|
+ } else {
|
|
|
+ return "FALSE";
|
|
|
+ }
|
|
|
+ } else if (iType == iSTRING) {
|
|
|
+ if (valObj == null) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ return (String) valObj;
|
|
|
+ }
|
|
|
+ } else if (iType == iNULL) {
|
|
|
+ return "";
|
|
|
+ } else if (iType == iOBJECT) {
|
|
|
+ return valObj.toString();
|
|
|
+ } else {
|
|
|
+ return getStrErr();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the current object.
|
|
|
+ * @return the object
|
|
|
+ */
|
|
|
+ public Object getObj() {
|
|
|
+ if (iType == iOBJECT) {
|
|
|
+ return valObj;
|
|
|
+ } else if (iType == iSTRING) {
|
|
|
+ return valObj;
|
|
|
+ } else if (iType == iREF) { //This technically should never be called - we should use getRng
|
|
|
+ return valObj;
|
|
|
+ } else if (iType == iDOUBLE) {
|
|
|
+ return new Double(valDoub);
|
|
|
+ } else if (iType == iBOOLEAN) {
|
|
|
+ return new Long((long) getDoub());
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //============IS METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of type double.
|
|
|
+ * @return TRUE if double
|
|
|
+ */
|
|
|
+ public boolean isDoub() {
|
|
|
+ return iType == iDOUBLE;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of type String.
|
|
|
+ * @return TRUE if String
|
|
|
+ */
|
|
|
+ public boolean isStr() {
|
|
|
+ return (iType == iSTRING) || (iType == iNULL);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of really String (ie not NULL) - used for ISTEXT function.
|
|
|
+ * @return TRUE if String
|
|
|
+ */
|
|
|
+ public boolean isStrReally() {
|
|
|
+ return (iType == iSTRING);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of type boolean.
|
|
|
+ * @return TRUE if boolean
|
|
|
+ */
|
|
|
+ public boolean isBool() {
|
|
|
+ return iType == iBOOLEAN;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of type reference.
|
|
|
+ * @return TRUE if reference
|
|
|
+ */
|
|
|
+ public boolean isRef() {
|
|
|
+ return iType == iREF;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the object is of type Object.
|
|
|
+ * @return TRUE if Object
|
|
|
+ */
|
|
|
+ public boolean isObj() {
|
|
|
+ return iType == iOBJECT;
|
|
|
+ }
|
|
|
+
|
|
|
+ //============SET ERR METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Stores the Error related attributes of valX in current object.
|
|
|
+ * This is similar to setVal(xValue valX), only valX is known to
|
|
|
+ * contain an error. It is provided for optimization purposes.
|
|
|
+ * @param valX the error
|
|
|
+ */
|
|
|
+ public void setValErr(xValue valX) {
|
|
|
+ iType = valX.iType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #DIV/0! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrDiv() {
|
|
|
+ iType = iERRDIV;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store an #N/A error in the object.
|
|
|
+ */
|
|
|
+ public void setErrNa() {
|
|
|
+ iType = iERRNA;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #NAME! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrName() {
|
|
|
+ iType = iERRNAME;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #NULL! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrNull() {
|
|
|
+ iType = iERRNULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #NUM! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrNum() {
|
|
|
+ iType = iERRNUM;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #REF! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrRef() {
|
|
|
+ iType = iERRREF;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a #VALUE! error in the object.
|
|
|
+ */
|
|
|
+ public void setErrVal() {
|
|
|
+ iType = iERRVALUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a non-Excel (generic) error in the object.
|
|
|
+ */
|
|
|
+ public void setErrGen() {
|
|
|
+ iType = iERRGEN;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //============GET ERR METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the current value is an error.
|
|
|
+ * @return TRUE if error
|
|
|
+ */
|
|
|
+ public boolean isErr() {
|
|
|
+ return iType > iNOERR;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the current value is an error, but not a #N/A error.
|
|
|
+ * @return TRUE if non-#N/A error
|
|
|
+ */
|
|
|
+ public boolean isErrButNA() {
|
|
|
+ return (iType > iNOERR && iType != iERRNA);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the String representation of the Error.
|
|
|
+ * @return the string error
|
|
|
+ */
|
|
|
+ public String getStrErr() {
|
|
|
+ if (iType == iERRDIV) {
|
|
|
+ return sERRDIV;
|
|
|
+ } else if (iType == iERRNA) {
|
|
|
+ return sERRNA;
|
|
|
+ } else if (iType == iERRNAME) {
|
|
|
+ return sERRNAME;
|
|
|
+ } else if (iType == iERRNULL) {
|
|
|
+ return sERRNULL;
|
|
|
+ } else if (iType == iERRNUM) {
|
|
|
+ return sERRNUM;
|
|
|
+ } else if (iType == iERRREF) {
|
|
|
+ return sERRREF;
|
|
|
+ } else if (iType == iERRVALUE) {
|
|
|
+ return sERRVALUE;
|
|
|
+ } else {
|
|
|
+ return sERRGEN;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the current value is a blank or null value.
|
|
|
+ * @return TRUE if blank
|
|
|
+ */
|
|
|
+ public boolean isBlank() {
|
|
|
+ if ((iType == iNULL) || (iType == iSTRING && (((String) valObj).length() == 0))) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns TRUE if the current value is a null value.
|
|
|
+ * @return TRUE if null
|
|
|
+ */
|
|
|
+ public boolean isEmptyString() {
|
|
|
+ if ((iType == iSTRING) && (((String) valObj).length() == 0)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //============GET TYPE METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns an int value representing the type of value stored
|
|
|
+ * in the current object.
|
|
|
+ * @return the type
|
|
|
+ */
|
|
|
+ public byte getTyp() {
|
|
|
+ return iType;
|
|
|
+ }
|
|
|
+
|
|
|
+ //============GET??FROMSTR METHOD SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns a double from a string - if possible
|
|
|
+ * @param sTemp the string
|
|
|
+ * @return the double
|
|
|
+ */
|
|
|
+ private double getDoubFromStr(String sOrig) {
|
|
|
+ sOrig = sOrig.trim();
|
|
|
+ while (sOrig.charAt(0) == '+') {
|
|
|
+ sOrig = sOrig.substring(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ int ii = 0;
|
|
|
+ int iLen = sOrig.length();
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ boolean bPer = false;
|
|
|
+
|
|
|
+ //Handle $, % and paren negatives
|
|
|
+ if (iLen > 2) {
|
|
|
+ char chr1 = sOrig.charAt(0);
|
|
|
+ if ((chr1 == '-') && (sOrig.charAt(1) == '$')) {
|
|
|
+ sb.append('-');
|
|
|
+ ii = ii + 2;
|
|
|
+ } else {
|
|
|
+ char chr4 = sOrig.charAt(iLen - 1);
|
|
|
+ boolean bNoDolOrPerFound = true;
|
|
|
+ if (chr1 == '$') {
|
|
|
+ ii++;
|
|
|
+ chr1 = sOrig.charAt(1);
|
|
|
+ bNoDolOrPerFound = false;
|
|
|
+ } else if (chr4 == '%') {
|
|
|
+ bPer = true;
|
|
|
+ chr4 = sOrig.charAt(iLen - 2);
|
|
|
+ iLen--;
|
|
|
+ bNoDolOrPerFound = false;
|
|
|
+ }
|
|
|
+ if ((chr1 == '(') && (chr4 == ')')) {
|
|
|
+ sb.append('-');
|
|
|
+ ii++;
|
|
|
+ iLen--;
|
|
|
+ if (bNoDolOrPerFound) {
|
|
|
+ if (sOrig.charAt(1) == '$') {
|
|
|
+ ii++;
|
|
|
+ } else if (sOrig.charAt(iLen - 1) == '%') { //We already subtracted once, so -1 instead of -2
|
|
|
+ bPer = true;
|
|
|
+ iLen--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (iLen == 2) {
|
|
|
+ if (sOrig.charAt(0) == '$') {
|
|
|
+ ii++;
|
|
|
+ } else if (sOrig.charAt(1) == '%') {
|
|
|
+ bPer = true;
|
|
|
+ iLen--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean bNum = true;
|
|
|
+
|
|
|
+ char chr = 0;
|
|
|
+ for (; (ii < iLen) && bNum; ii++) {
|
|
|
+ chr = sOrig.charAt(ii);
|
|
|
+ if (Character.isDigit(chr) || (chr == '-') || (chr == '.') || (chr == 'E')) {
|
|
|
+ sb.append(chr);
|
|
|
+ } else if (chr == ',') {
|
|
|
+ //Look ahead
|
|
|
+ if (!Character.isDigit(sOrig.charAt(ii + 1)) ||!Character.isDigit(sOrig.charAt(ii + 2)) ||!Character.isDigit(sOrig.charAt(ii + 3))) {
|
|
|
+ bNum = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ bNum = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!bNum) {
|
|
|
+ throw new NumberFormatException();
|
|
|
+ } else {
|
|
|
+ //The code below replaces the commented code below it, so that we don't get more decimals than necessary
|
|
|
+ if (bPer) { //It will bomb here if not double
|
|
|
+ boolean bNeg = (sb.charAt(0) == '-');
|
|
|
+ if (bNeg) {
|
|
|
+ sOrig = "000" + sb.toString().substring(1);
|
|
|
+ } else {
|
|
|
+ sOrig = "000" + sb.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ int iDec = sOrig.indexOf(".");
|
|
|
+ if (iDec == -1) {
|
|
|
+ iDec = sOrig.length();
|
|
|
+ } else {
|
|
|
+ sOrig = sOrig.substring(0, iDec) + sOrig.substring(iDec + 1);
|
|
|
+ }
|
|
|
+ iDec = iDec - 2;
|
|
|
+ if (bNeg) {
|
|
|
+ return -Double.parseDouble(sOrig.substring(0, iDec) + "." + sOrig.substring(iDec));
|
|
|
+ } else {
|
|
|
+ return Double.parseDouble(sOrig.substring(0, iDec) + "." + sOrig.substring(iDec));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Double.parseDouble(sb.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ /*if (bPer) { //It will bomb here if not double
|
|
|
+ return Double.parseDouble(sTemp) / 100;
|
|
|
+ } else {
|
|
|
+ return Double.parseDouble(sTemp);
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //============CLEANUP SECTION============
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Cleans up the instance of the class.
|
|
|
+ * Used to set all objects to null so that they can be released.
|
|
|
+ */
|
|
|
+ public void cleanUp() {
|
|
|
+ valObj = null;
|
|
|
+ }
|
|
|
+}
|