/** * Sets a value for the given series. * * @param key * The name of the series to modify. * @param x * The x value. * @param y * The y value. */ public void setEntry(final String key, final Object x, final Number y) { final CacheMap newCacheMap = new CacheMap(this.maxEntriesPerSeries); final CacheMap oldCacheMap = this.entries.putIfAbsent(key, newCacheMap); final CacheMap syncObj; if (oldCacheMap != null) { syncObj = oldCacheMap; } else { syncObj = newCacheMap; } synchronized (syncObj) { syncObj.put(x, y); } }
/** * Sets a value for the given series. * * @param key * The name of the series to modify. * @param x * The x value. * @param y * The y value. */ public void setEntry(final String key, final Object x, final Number y) { final CacheMap newCacheMap = new CacheMap(this.maxEntriesPerSeries); final CacheMap oldCacheMap = this.entries.putIfAbsent(key, newCacheMap); final CacheMap syncObj; if (oldCacheMap != null) { syncObj = oldCacheMap; } else { syncObj = newCacheMap; } synchronized (syncObj) { syncObj.put(x, y); } }
@Override protected boolean removeEldestEntry(final Map.Entry<Object, Number> entry) { return this.size() > this.maxEntriesPerSeries; }
@Override protected boolean removeEldestEntry(final Map.Entry<Object, Number> entry) { return this.size() > this.maxEntriesPerSeries; }