Lines Matching full:value
87 * return new InternalEntry<K, V>(key, original.hash, original.value, next);
89 * public void setValue(InternalEntry<K, V> entry, V value) {
90 * entry.value = value;
92 * public V getValue(InternalEntry<K, V> entry) { return entry.value; }
108 * volatile V value;
110 * InternalEntry(K key, int hash, V value, InternalEntry<K, V> next) {
113 * this.value = value;
173 * concurrency will vary. Ideally, you should choose a value to accommodate
175 * significantly higher value than you need can waste space and time,
176 * and a significantly lower value can lead to thread contention. But
178 * not usually have much noticeable impact. A value of one is
217 * returns the value corresponding to the given key, atomically computes
219 * another thread to compute the value if necessary. Only one value will
222 * <p>If an entry's value has not finished computing yet, query methods
225 * the value's computation completes.
286 * or values for various reasons. For example, the key or value may have
322 * Copies the value and any other implementation-specific state from
331 * @param original entry from which the value and other
339 * Sets the value of an entry using volatile semantics. Values are set
342 * @param entry to set the value on
343 * @param value to set
345 void setValue(E entry, V value);
348 * Gets the value of an entry using volatile semantics.
350 * @param entry to get the value from
367 * value will be null.
369 * @param a value from inside the map
370 * @param b value passed from caller, not necesarily of type V
449 * Removes the given entry from the map if the value of the entry in the
450 * map matches the given value.
453 * @param value entry must have for the removal to succeed
457 boolean removeEntry(E entry, @Nullable V value);
471 * Implementations should typically intialize the entry's value to a
472 * placeholder value in {@link #newEntry(Object, int, Object)} so that
474 * pre-intialized value and an in-progress computation. {@link
486 * Computes a value for the given key and stores it in the given entry.
497 * @return the computed value
502 * Gets a value from an entry waiting for the value to be set by {@link
503 * #compute} if necessary. Returns null if a value isn't available at
504 * which point CustomConcurrentHashMap tries to compute a new value.
506 * @param entry to return value from
507 * @return stored value or null if the value isn't available
547 * The maximum capacity, used if a higher value is implicitly specified by
575 * Mask value for indexing into segments. The upper bits of a key's hash
581 * Shift value for indexing within segments. Helps prevent entries that
653 public boolean removeEntry(E entry, V value) {
658 return segmentFor(hash).removeEntry(entry, hash, value);
755 * value of this field is always {@code (int)(capacity * loadFactor)}.)
836 // Return true only if this entry has a value.
845 boolean containsValue(Object value) {
854 // If the value disappeared, this entry is partially collected,
860 if (s.equalValues(entryValue, value)) {
878 // If the value disappeared, this entry is partially collected,
906 // If the value disappeared, this entry is partially collected,
924 V put(K key, int hash, V value, boolean onlyIfAbsent) {
945 // If the value disappeared, this entry is partially collected,
952 s.setValue(e, value);
960 s.setValue(newEntry, value);
1081 boolean remove(Object key, int hash, Object value) {
1095 if (value == entryValue || (value != null && entryValue != null
1096 && s.equalValues(entryValue, value))) {
1125 public boolean removeEntry(E entry, int hash, V value) {
1137 if (entryValue == value || (value != null
1138 && s.equalValues(entryValue, value))) {
1223 * Returns {@code true} if this map contains no key-value mappings.
1225 * @return {@code true} if this map contains no key-value mappings
1262 * Returns the number of key-value mappings in this map. If the map
1266 * @return the number of key-value mappings in this map
1316 * Returns the value to which the specified key is mapped, or {@code null}
1320 * a value {@code v} such that {@code key.equals(k)}, then this method
1353 * value. Note: This method requires a full internal traversal of the hash
1356 * @param value value whose presence in this map is to be tested
1358 * value
1359 * @throws NullPointerException if the specified value is null
1361 @Override public boolean containsValue(Object value) {
1362 if (value == null) {
1363 throw new NullPointerException("value");
1378 if (segments[i].containsValue(value)) {
1404 if (segment.containsValue(value)) {
1418 * Maps the specified key to the specified value in this table. Neither the
1419 * key nor the value can be null.
1421 * <p> The value can be retrieved by calling the {@code get} method with a
1424 * @param key key with which the specified value is to be associated
1425 * @param value value to be associated with the specified key
1426 * @return the previous value associated with {@code key}, or {@code null}
1428 * @throws NullPointerException if the specified key or value is null
1430 @Override public V put(K key, V value) {
1434 if (value == null) {
1435 throw new NullPointerException("value");
1438 return segmentFor(hash).put(key, hash, value, false);
1444 * @return the previous value associated with the specified key, or
1446 * @throws NullPointerException if the specified key or value is null
1448 public V putIfAbsent(K key, V value) {
1452 if (value == null) {
1453 throw new NullPointerException("value");
1456 return segmentFor(hash).put(key, hash, value, true);
1473 * Removes the key (and its corresponding value) from this map. This method
1477 * @return the previous value associated with {@code key}, or {@code null}
1494 public boolean remove(Object key, Object value) {
1499 return segmentFor(hash).remove(key, hash, value);
1524 * @return the previous value associated with the specified key, or
1526 * @throws NullPointerException if the specified key or value is null
1528 public V replace(K key, V value) {
1532 if (value == null) {
1533 throw new NullPointerException("value");
1536 return segmentFor(hash).replace(key, hash, value);
1697 V value = s.getValue(entry);
1698 if (key != null && value != null) {
1699 nextExternal = new WriteThroughEntry(key, value);
1749 V value;
1751 WriteThroughEntry(K key, V value) {
1753 this.value = value;
1761 return value;
1765 * Set our entry's value and write through to the map. The value to
1768 * value could be different from what we return (or could even have been
1772 @Override public V setValue(V value) {
1773 if (value == null) {
1776 V oldValue = Impl.this.put(getKey(), value);
1777 this.value = value;
1968 V value = (V) in.readObject();
1969 put(key, value);
2045 V value = computingStrategy.compute(key, entry, computer);
2046 if (value == null) {
2051 return value;
2065 V value = computingStrategy.waitForValue(entry);
2066 if (value == null) {
2071 return value;
2113 key, original.hash, original.value, next);
2115 public void setValue(SimpleInternalEntry<K, V> entry, V value) {
2116 entry.value = value;
2119 return entry.value;
2152 volatile V value;
2154 K key, int hash, @Nullable V value, SimpleInternalEntry<K, V> next) {
2157 this.value = value;