@Override public Object put(Object key, Object value) { if (maxSize != Integer.MAX_VALUE) removeOverflow(true); return super.put(key, value); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
private void initializeMaps() { ConcurrentReferenceHashMap statsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR); statsMap.setMaxSize(FIXED_SIZE); stats = statsMap; ConcurrentReferenceHashMap aStatsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR); aStatsMap.setMaxSize(FIXED_SIZE); astats = aStatsMap; }
protected boolean eq(Object x, Object y) { // the Entries in ConcurrentReferenceHashMap delegate back to // eq() in their equals() impls if (x instanceof Map.Entry) return super.eq(x, y); else return x == y; }
/** * Method insures that deserialized EMF has this reference re-instantiated */ private Collection getPcClassLoaders() { if (_pcClassLoaders == null) _pcClassLoaders = new ConcurrentReferenceHashSet( ConcurrentReferenceHashSet.WEAK); return _pcClassLoaders; } }
public void addListener(Object listener) { super.addListener(listener); if (listener instanceof BeginTransactionListener) _begin++; if (listener instanceof FlushTransactionListener) _flush++; if (listener instanceof EndTransactionListener) _end++; }
@Override public Object putIfAbsent(Object key, Object value) { if (maxSize != Integer.MAX_VALUE) removeOverflow(true); return super.putIfAbsent(key, value); }
/** * Default constructor. */ public AbstractConcurrentEventManager() { _listeners = newListenerCollection(); }
/** * Returns <tt>true</tt> if this map contains a mapping for the * specified key. * * @param key The key whose presence in this map is to be tested * @return <tt>true</tt> if this map contains a mapping for the specified * key. */ public final boolean containsKey(Object key) { return getEntry(key) != null; }
/** * Equivalent to <code>removeOverflow(false)</code>. */ protected void removeOverflow() { removeOverflow(false); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
@Override public Object put(Object key, Object value) { if (maxSize != Integer.MAX_VALUE) removeOverflow(true); return super.put(key, value); }
@Override public Object putIfAbsent(Object key, Object value) { if (maxSize != Integer.MAX_VALUE) removeOverflow(true); return super.putIfAbsent(key, value); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }