![JAR search and dependency download from the Maven repository](/logo.png)
com.bumptech.glide.load.engine.bitmap_recycle.BaseKeyPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glide Show documentation
Show all versions of glide Show documentation
A fast and efficient image loading library for Android focused on smooth scrolling.
package com.bumptech.glide.load.engine.bitmap_recycle;
import com.bumptech.glide.util.Util;
import java.util.Queue;
abstract class BaseKeyPool {
private static final int MAX_SIZE = 20;
private final Queue keyPool = Util.createQueue(MAX_SIZE);
protected T get() {
T result = keyPool.poll();
if (result == null) {
result = create();
}
return result;
}
public void offer(T key) {
if (keyPool.size() < MAX_SIZE) {
keyPool.offer(key);
}
}
protected abstract T create();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy