Class PainterCache<K,​V>


  • public class PainterCache<K,​V>
    extends Object
    Provides one way of asynchronously computing a long-running task for painting. For example:
     
     public class MyPainter extends GlimpsePainterBase
     {
         int paintFrame;
         PaintingCache<Integer, V> cache;
    
         public MyPainter( )
         {
             paintFrame = -1;
             cache = new PaintingCache<>( this::computeForFrame );
         }
    Author:
    borkholder
    • Field Detail

      • SHARED_EXEC

        public static Executor SHARED_EXEC
    • Constructor Detail

      • PainterCache

        public PainterCache​(Function<K,​V> computeF)
    • Method Detail

      • get

        public V get​(K key)
      • invalidate

        public void invalidate​(K key)
      • clear

        public void clear()