@Test public void testFloatPromotion() throws Exception { BdfDictionary d = new BdfDictionary(); d.put("foo", 1F); d.put("bar", 2D); assertEquals(Double.valueOf(1), d.getDouble("foo")); assertEquals(Double.valueOf(2), d.getDouble("bar")); }
public Double getDouble(String key) throws FormatException { Object o = get(key); if (o instanceof Double) return (Double) o; if (o instanceof Float) return ((Float) o).doubleValue(); throw new FormatException(); }
BdfDictionary extends TreeMap<String, Object> { public Double getDouble(String key) throws FormatException { Object o = get(key); if (o instanceof Double) return (Double) o; if (o instanceof Float) return ((Float) o).doubleValue(); throw new FormatException(); } }
BdfDictionary extends TreeMap<String, Object> { public Double getDouble(String key) throws FormatException { Object o = get(key); if (o instanceof Double) return (Double) o; if (o instanceof Float) return ((Float) o).doubleValue(); throw new FormatException(); } BdfDictionary();  BdfDictionary(Map<String, ?> m); }
BdfDictionary extends TreeMap<String, Object> { public Double getDouble(String key) throws FormatException { Object o = get(key); if (o instanceof Double) return (Double) o; if (o instanceof Float) return ((Float) o).doubleValue(); throw new FormatException(); } BdfDictionary();  BdfDictionary(Map<String, ?> m); static BdfDictionary of(Entry<String, ?>... entries); Boolean getBoolean(String key); @Nullable Boolean getOptionalBoolean(String key); Boolean getBoolean(String key, Boolean defaultValue); Long getLong(String key); @Nullable Long getOptionalLong(String key); Long getLong(String key, Long defaultValue); Double getDouble(String key); @Nullable Double getOptionalDouble(String key); Double getDouble(String key, Double defaultValue); String getString(String key); @Nullable String getOptionalString(String key); String getString(String key, String defaultValue); byte[] getRaw(String key); @Nullable byte[] getOptionalRaw(String key); byte[] getRaw(String key, byte[] defaultValue); BdfList getList(String key); @Nullable BdfList getOptionalList(String key); BdfList getList(String key, BdfList defaultValue); BdfDictionary getDictionary(String key); @Nullable BdfDictionary getOptionalDictionary(String key); BdfDictionary getDictionary(String key, BdfDictionary defaultValue); }
BdfDictionary extends TreeMap<String, Object> { public Double getDouble(String key) throws FormatException { Object o = get(key); if (o instanceof Double) return (Double) o; if (o instanceof Float) return ((Float) o).doubleValue(); throw new FormatException(); } BdfDictionary();  BdfDictionary(Map<String, ?> m); static BdfDictionary of(Entry<String, ?>... entries); Boolean getBoolean(String key); @Nullable Boolean getOptionalBoolean(String key); Boolean getBoolean(String key, Boolean defaultValue); Long getLong(String key); @Nullable Long getOptionalLong(String key); Long getLong(String key, Long defaultValue); Double getDouble(String key); @Nullable Double getOptionalDouble(String key); Double getDouble(String key, Double defaultValue); String getString(String key); @Nullable String getOptionalString(String key); String getString(String key, String defaultValue); byte[] getRaw(String key); @Nullable byte[] getOptionalRaw(String key); byte[] getRaw(String key, byte[] defaultValue); BdfList getList(String key); @Nullable BdfList getOptionalList(String key); BdfList getList(String key, BdfList defaultValue); BdfDictionary getDictionary(String key); @Nullable BdfDictionary getOptionalDictionary(String key); BdfDictionary getDictionary(String key, BdfDictionary defaultValue); static final Object NULL_VALUE; }