Returns the integer value of the input string. Handles both straight integer string or complex KMG (CLOB or BLOB) value.

@param value
@return integer value
@throws NumberFormatException if a valid integer is not found
771268
protected long parseLong( String value ) {
        long factor = 1;
        if (value.endsWith("K")) {
            factor = KILO;
        } else if (value.endsWith("M")) {
            factor = MEGA;
        } else if (value.endsWith("G")) {
            factor = GIGA;
        }
        if (factor > 1) {
            value = value.substring(0, value.length() - 1);
        }
        return new BigInteger(value).longValue() * factor;
    }
260065
private int idToInt(String value) {
    try {
      return Integer.valueOf(value);
    } catch (NumberFormatException e) {
      throw new ConfigurationException("invalid type ID: " + value);
    }
  }
811160
public static Integer asInteger(Object value) {
    int intValue;
    switch (value.getClass().getCanonicalName()) {
      case "java.math.BigDecimal":
        intValue = ((BigDecimal) value).intValue();
        break;
      case "java.lang.Boolean":
        intValue = (Boolean) value ? 1 : 0;
        break;
      case "java.lang.Integer":
        intValue = (Integer) value;
        break;
      default:
        intValue = (Integer) value;
        break;
    }
    return intValue;
  }
970323
public static UShort ushort(String value) throws NumberFormatException {
        return value == null ? null : UShort.valueOf(value);
    }
1201424
public final static String toClockString(int value)
	{
		if (value < 10)
			return "0" + Integer.toString(value);
		return Integer.toString(value);
	}
257927
private function convertInt($value)
    {
        if (!is_numeric($value)) {
            return $value;
        }

        if ((string) (int) $value !== (string) $value) {
            return $value;
        }

        return (int) $value;
    }
1080327
public static function integer($value){

		$value = static::_nullValue($value);

		if($value !== null){

			$value = (int) $value;
		}

		return $value;
	}
1159141
private int parseInteger(String value, int defaultValue)
	{
		try
		{
			return Integer.parseInt(value);
		}
		catch (NumberFormatException e)
		{
			return defaultValue;
		}
	}
663263
public static final Number parseUnits(Number value)
   {
      return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
   }
971952
public static Integer isInteger(String value) {
		Validate.notNull(value);
		Validate.notEmpty(value);
		Integer intValue = null;
		try{
			intValue = 	Integer.parseInt(value);
		} catch(NumberFormatException e){
			throw new TypeException("Integer");
		}
		return intValue;
	}
262660
private static Number asNumber(Object value) {
    Number num = null;
    if (value == null) {
      num = null;
    } else if (value instanceof Number) {
      num = (Number) value;
    } else if (value instanceof Boolean) {
      num = ((Boolean) value) ? 1 : 0;
    }
    return num;
  }
1146512
static
	private Integer toInteger(Object value){

		if(value instanceof Integer){
			return (Integer)value;
		} else

		if((value instanceof Double) || (value instanceof Float)){
			Number number = (Number)value;

			if(DoubleMath.isMathematicalInteger(number.doubleValue())){
				return toInteger(number.longValue());
			}
		} else

		if(value instanceof Long){
			Long number = (Long)value;

			return toInteger(number.longValue());
		} else

		if((value instanceof Short) || (value instanceof Byte)){
			Number number = (Number)value;

			return Integer.valueOf(number.intValue());
		} else

		if(value instanceof Boolean){
			Boolean flag = (Boolean)value;

			return (flag.booleanValue() ? Numbers.INTEGER_ONE : Numbers.INTEGER_ZERO);
		} else

		if((value instanceof DaysSinceDate) || (value instanceof SecondsSinceDate) || (value instanceof SecondsSinceMidnight)){
			Number number = (Number)value;

			return Integer.valueOf(number.intValue());
		}

		throw new TypeCheckException(DataType.INTEGER, value);
	}
520279
public static int generate(String value)
  {
    int len = value.length();
    int crc = 0;

    for (int i = 0; i < len; i++) {
      crc = next(crc, value.charAt(i));
    }

    return crc;
  }
1360617
public Integer convertToInt(String value) {
        Integer result = null;
        if (value != null) {
            result = Integer.valueOf(value);
        }
        return result;
    }
935693
public static boolean isNumeric(Object value) {
		if (value == null) return false;
		if (value instanceof Number) return true;
		if (value instanceof String) {
			String stringValue = (String) value;
			if (isNullOrEmpty(stringValue)) return true;
			return isNumber(stringValue);
		}
		return false;
	}
783712
public static BigInteger read(String value) {
		if (!StringUtils.hasText(value)) return null;
		
		return new BigInteger(value);
	}
1250111
private static Integer integerValueOf(String value) {
		try {
			return Integer.valueOf(value);
		} catch (NumberFormatException e) {
			throw new CannotParseException(40, value);
		}
	}