Java Code Examples for java.lang.ref.WeakReference#hashCode()
The following examples show how to use
java.lang.ref.WeakReference#hashCode() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProfilerRuntimeObjLiveness.java From netbeans with Apache License 2.0 | 5 votes |
public synchronized void put(WeakReference key) { if (nObjects > threshold) { rehash(); } int pos = (key.hashCode() & 0x7FFFFFFF) % capacity; while (keys[pos] != null) { pos = (pos + 1) % capacity; } keys[pos] = key; nObjects++; }
Example 2
Source File: ProfilerRuntimeObjLiveness.java From netbeans with Apache License 2.0 | 5 votes |
public synchronized void remove(WeakReference key) { int pos = (key.hashCode() & 0x7FFFFFFF) % capacity; while (keys[pos] != key) { pos = (pos + 1) % capacity; } keys[pos] = null; nObjects--; }
Example 3
Source File: ProfilerRuntimeObjLiveness.java From visualvm with GNU General Public License v2.0 | 5 votes |
public synchronized void put(WeakReference key) { if (nObjects > threshold) { rehash(); } int pos = (key.hashCode() & 0x7FFFFFFF) % capacity; while (keys[pos] != null) { pos = (pos + 1) % capacity; } keys[pos] = key; nObjects++; }
Example 4
Source File: ProfilerRuntimeObjLiveness.java From visualvm with GNU General Public License v2.0 | 5 votes |
public synchronized void remove(WeakReference key) { int pos = (key.hashCode() & 0x7FFFFFFF) % capacity; while (keys[pos] != key) { pos = (pos + 1) % capacity; } keys[pos] = null; nObjects--; }