Lines Matching refs:duration

436   MapMaker expiration(long duration, TimeUnit unit) {
437 return expireAfterWrite(duration, unit);
441 * Specifies that each entry should be automatically removed from the map once a fixed duration
444 * <p>When {@code duration} is zero, elements can be successfully added to the map, but are
454 * @param duration the length of time after an entry is created that it should be automatically
456 * @param unit the unit that {@code duration} is expressed in
457 * @throws IllegalArgumentException if {@code duration} is negative
465 MapMaker expireAfterWrite(long duration, TimeUnit unit) {
466 checkExpiration(duration, unit);
467 this.expireAfterWriteNanos = unit.toNanos(duration);
468 if (duration == 0 && this.nullRemovalCause == null) {
476 private void checkExpiration(long duration, TimeUnit unit) {
481 checkArgument(duration >= 0, "duration cannot be negative: %s %s", duration, unit);
489 * Specifies that each entry should be automatically removed from the map once a fixed duration
492 * <p>When {@code duration} is zero, elements can be successfully added to the map, but are
502 * @param duration the length of time after an entry is last accessed that it should be
504 * @param unit the unit that {@code duration} is expressed in
505 * @throws IllegalArgumentException if {@code duration} is negative
514 MapMaker expireAfterAccess(long duration, TimeUnit unit) {
515 checkExpiration(duration, unit);
516 this.expireAfterAccessNanos = unit.toNanos(duration);
517 if (duration == 0 && this.nullRemovalCause == null) {