Adds another constructor to allow the user to specify a totally custom cache.
@@ -66,6 +66,23 @@ public final class ImageCache {
.build();
}
+ /**
+ * Constructs a new ImageCache.
+ *
+ * @param font
+ * The font.
+ *
+ * @param cache
+ * The cache.
+ *
+ * @throws NullPointerException
+ * If the font or cache is null.
+ */
+ public ImageCache(final @NonNull Font font, final @NonNull Cache<Integer, VolatileImage> cache) {
+ this.font = font;
+ this.cachedImages = cache;
+ }
+
/**
* Retrieves a character image from the cache.
*
