Get the Number value associated with a key.

@param key
A key string.
@return The numeric value.
@throws JSONException
if the key is not found or if the value is not a Number
object and cannot be converted to a number.
342606
public Number getNumber(String key) throws JSONException {
        Object object = this.get(key);
        try {
            if (object instanceof Number) {
                return (Number)object;
            }
            return stringToNumber(object.toString());
        } catch (Exception e) {
            throw new JSONException("JSONObject[" + quote(key)
                    + "] is not a number.", e);
        }
    }
913629
public int getInt(String key) {
    if (containsKey(key)) {
      return Integer.parseInt(get(key));
    } else {
      throw new IllegalArgumentException("Missing key " + key + ".");
    }
  }
1317360
public static long getInt(String key, int valueIfNullOrNotParseable) {
        String value = System.getProperty(key);
        if (Strings.isNullOrEmpty(value)) {
            return valueIfNullOrNotParseable;
        }
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            return valueIfNullOrNotParseable;
        }
    }
627865
@Override
    public Number getNumber(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        synchronized (lock) {
            final Object obj = getMValue(internalDict, key).asNative(internalDict);
            return CBLConverter.asNumber(obj);
        }
    }
1058108
public static int getInt(JSONValue value) {
        if (value == null)
            return 0;
        if (!(value instanceof Number))
            throw new JSONException(NOT_A_NUMBER);
        return ((Number)value).intValue();
    }
55410
@NonNull
    @Override
    public MutableDocument setNumber(@NonNull String key, Number value) {
        return setValue(key, value);
    }
320035
public Object get (int key)
    {
        int size = _keys.length, start = key % size;
        for (int ii = 0; ii < size; ii++) {
            int idx = (ii + start) % size;
            if (_keys[idx] == key) {
                return _values[idx];
            }
        }
        return null;
    }
1348984
public Object getValue(String key) {
        if (values == null) {
            return null;
        }
        return values.get(key);
    }
482308
public int getInt(String key) {
		addToDefaults(key, null);
		String value = getRequired(key);
		return Integer.parseInt(value);
	}
183750
public int getInt(String key){
        try {
            return Integer.parseInt(resource.getString(key));
        } catch (NumberFormatException e) {
            return -1; // modify here if you need to throw a Exception here
        }
    }
676914
public Number getAsNumber(String key) {
		Object obj = this.get(key);
		if (obj == null)
			return null;
		if (obj instanceof Number)
			return (Number)obj;
		return Long.valueOf(obj.toString());
	}
450385
public JSONObject getObject(String key) {
        Object tmp = objectMap.get(key);
        return tmp == null ? null
                : tmp instanceof JSONObject ? (JSONObject) tmp : null;
    }
1250324
public int getInt(String key, int def) {
        Object tmp = objectMap.get(key);
        return tmp != null && tmp instanceof Number ? ((Number) tmp).intValue()
                : def;
    }
989510
public int find(Object key) {
        Object o = this.map.get(key);
        return o instanceof Integer ? ((Integer) o).intValue() : none;
    }
671242
public static int getInt(CSProperties p, String key) throws ParseException {
        String val = p.get(key).toString();
        if (val == null) {
            throw new IllegalArgumentException(key);
        }
        return Integer.parseInt(val);
    }
667383
public Integer getIntegerFrom(JsonValue json) {
    if (json.isNumber()) {
      return json.asInt();
    } else {
      return Integer.valueOf(json.asString());
    }
  }
998743
public float getFloat(final String key) {
		final String value = getProperty(key);
		if (value == null) {
			throw new NumberFormatException("Couldn't parse property to float.");
		}
		return Float.parseFloat(value);
	}