/** Removes the entry whose next access is farthest away into the future. */ private void evict() { data.remove(data.lastInt()); policyStats.recordEviction(); } }
private int getLowestFixSameVersion(final int versionKey) { if (versionKey < fixerVersions.firstInt()) { // can have a version before everything else return fixerVersions.firstInt() - 1; } return fixerVersions.subSet(0, versionKey + 1).lastInt(); }
@Override public int lastInt() { synchronized (sync) { return sortedSet.lastInt(); } } /**
@Override public int lastInt() { return sortedSet.lastInt(); } /**
/** * {@inheritDoc} * * @deprecated Please use the corresponding type-specific method instead. */ @Deprecated @Override default Integer last() { return Integer.valueOf(lastInt()); } }
@Override public int lastIndexOf(final Object o) { final int result; final IntSortedSet indices = reverseLookupMap.get(o); if (indices.isEmpty()) { result = -1; } else { result = indices.lastInt(); } return result; }
/** Removes the entry whose next access is farthest away into the future. */ private void evict() { data.remove(data.lastInt()); policyStats.recordEviction(); } }
/** * Returns the minimal range that * {@linkplain IntRange#contains(int) contains} all of the given values. * The returned range is {@linkplain BoundType#CLOSED closed} on both ends. * * @throws ClassCastException if the parameters are not <i>mutually * comparable</i> * @throws NoSuchElementException if {@code values} is empty * @throws NullPointerException if any of {@code values} is null * @since 14.0 */ public static IntRange encloseAll(IntCollection values) { checkNotNull(values); if (values instanceof IntSortedSet) { IntSortedSet setValues = (IntSortedSet) values; return closed(setValues.firstInt(), setValues.lastInt()); } IntIterator valueIterator = values.iterator(); int min = checkNotNull(valueIterator.next()); int max = min; while (valueIterator.hasNext()) { int value = checkNotNull(valueIterator.next()); min = Integer.min(min, value); max = Integer.max(max, value); } return closed(min, max); }