Class BulkImageLoader

  • All Implemented Interfaces:
    java.lang.Runnable

    public class BulkImageLoader
    extends java.lang.Thread
    This class is used to load and release lots of images when used for a book, for example. It loads the images in a thread and release old images to keep memory usage low. Use it with DynImage. See the ImageBook and the Product Store samples.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  BulkImageLoader.DynImage
      class used to show the Image on screen.
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String[] arqs  
      int current  
      Image[] loaded  
      int pagesInMemory  
      int pageSize  
      boolean running  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      BulkImageLoader​(int pagesInMemory, int pageSize, java.lang.String imageFolder, java.lang.String[] arqs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Image getImage​(int idx)
      Returns the image at the given index
      void run()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • running

        public boolean running
      • pagesInMemory

        public int pagesInMemory
      • pageSize

        public int pageSize
      • current

        public int current
      • arqs

        public java.lang.String[] arqs
      • loaded

        public Image[] loaded
    • Constructor Detail

      • BulkImageLoader

        public BulkImageLoader​(int pagesInMemory,
                               int pageSize,
                               java.lang.String imageFolder,
                               java.lang.String[] arqs)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread