Lines Matching refs:size
33 private int size;
56 * Sets the size of the cache.
58 * @param maxSize The new maximum size.
112 size += safeSizeOf(key, createdValue);
139 size += safeSizeOf(key, value);
142 size -= safeSizeOf(key, previous);
156 * below the requested size.
158 * @param maxSize the maximum size of the cache before returning. May be -1
166 if (size < 0 || (map.isEmpty() && size != 0)) {
171 if (size <= maxSize || map.isEmpty()) {
179 size -= safeSizeOf(key, value);
201 size -= safeSizeOf(key, previous);
251 throw new IllegalStateException("Negative size: " + key + "=" + value);
257 * Returns the size of the entry for {@code key} and {@code value} in
258 * user-defined units. The default implementation returns 1 so that size
259 * is the number of entries and max size is the maximum number of entries.
261 * <p>An entry's size must not change while it is in the cache.
279 public synchronized final int size() {
280 return size;