Class ViewPoolEntryHolder


  • public class ViewPoolEntryHolder
    extends Object
    Fast pool using ConcurrentLinkedQueue, with uses an AtomicInteger as count limit. The reasons of design this pool in this way are:
    1. There is no need to put a hard limit about the max number of views stored in the pool. Remember ViewEntry internally has a Soft or Weak reference over the view. The maxCount is just a way to limit the max footprint fo the pool in memory, but if the limit is exceed, the vm can always reclaim the memory space.
    2. View creation is quite fast, so according to previous tests done, include any syncronized method in this code will produce worse performance.
    Author:
    Leonardo Uribe
    • Constructor Detail

      • ViewPoolEntryHolder

        public ViewPoolEntryHolder​(int maxCount)
    • Method Detail

      • add

        public boolean add​(ViewEntry entry)
      • isFull

        public boolean isFull()
      • getCount

        public int getCount()