Class LazyLoadItemList<E>

    • Field Detail

      • PREFETCH_SIZE_PROPERTY

        public static final java.lang.String PREFETCH_SIZE_PROPERTY
        See Also:
        Constant Field Values
      • DEFAULT_PREFETCH_SIZE

        public static final int DEFAULT_PREFETCH_SIZE
        The value for DEFAULT_PREFETCH_SIZE is read from the configuration properties. The key is lazy.pkcollection.prefetchsize.
        See Also:
        Constant Field Values
      • EMPTY_LIST

        public static final LazyLoadItemList EMPTY_LIST
        Static, light-weight empty list instance. Should be used where an empty list stub is needed.
      • DEFUALT_PREFETCH_SIZE

        @Deprecated
        public static final int DEFUALT_PREFETCH_SIZE
        Deprecated.
        since ages
        deprecated, use DEFAULT_PREFETCH_SIZE instead (without typo)
        See Also:
        Constant Field Values
    • Constructor Detail

      • LazyLoadItemList

        public LazyLoadItemList()
        This constructor usees as prefetch size DEFAULT_PREFETCH_SIZE.
      • LazyLoadItemList

        public LazyLoadItemList​(java.util.Set<PK> prefetchLanguages,
                                java.util.List<PK> pks,
                                int prefetchSize)
        LazyLoadItemList Constructor.
        Parameters:
        prefetchLanguages -
        pks -
        prefetchSize - use postive values only or DEFAULT_PREFETCH_SIZE for reading the value from the configuration properties.
      • LazyLoadItemList

        protected LazyLoadItemList​(java.util.Set<PK> prefetchLanguages,
                                   java.util.List<PK> pks,
                                   int prefetchSize,
                                   boolean modifable)
    • Method Detail

      • get

        public E get​(int index)
              throws java.lang.IndexOutOfBoundsException
        Specified by:
        get in interface java.util.List<E>
        Specified by:
        get in class BaseLazyLoadItemList<E>
        Throws:
        java.lang.IndexOutOfBoundsException
      • getBuffered

        protected E getBuffered​(int listPos)
        Gets an object of type E for absolute global given listPos. Internally it checks if this index is accessible for the current page if not appropriate page is loaded.

        Method ensured by change of volatile currentBufferedPage to retrieve consistent result for given index in multi-threaded environment.

      • loadPage

        protected java.util.List<E> loadPage​(java.util.List<PK> pks)
        Override this method to provide a resolving mechanism for generating values for the pre-fetched BaseLazyLoadItemList.pkList entries.
      • set

        public E set​(int index,
                     java.lang.Object element)
        Does not completely fulfill the set() contract. To make sure this method does not instantiate the item at the given index, always null is returned.
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class BaseLazyLoadItemList<E>
      • add

        public void add​(int index,
                        java.lang.Object element)
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
      • remove

        public E remove​(int index)
        Does not completely fulfill the remove() contract. To make sure this method does not instantiate the item at the given index, always null is returned.
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class BaseLazyLoadItemList<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class BaseLazyLoadItemList<E>
      • setPreFetchSize

        @Deprecated
        public void setPreFetchSize​(int preFetchSize)
        Deprecated.
        since 4.8 does not have a counter part - set a prefetch size in constructor
        If you wish to use the prefetch value from the configuration properties, prefer DEFAULT_PREFETCH_SIZE instead of -1. Other negative values are interpreted as -1. If you add a negative or invalid value to the configuration property key lazy.pkcollection.prefetchsize, the prefetch size is set to 100.

        If you do not wish to use the value from the configuration properties, use positive values only.

        Parameters:
        preFetchSize - the size of the prefetched elements for the list. Has to be a positive value.
      • isIgnoreMissing

        @Deprecated
        public boolean isIgnoreMissing()
        Deprecated.
        since 4.8
        Returns:
        the ignoreMissing
      • setIgnoreMissing

        @Deprecated
        public void setIgnoreMissing​(boolean ignoreMissing)
        Deprecated.
        since 4.8
        Parameters:
        ignoreMissing - the ignoreMissing to set
      • setModifiable

        @Deprecated
        public void setModifiable​(boolean modifiable)
        Deprecated.
        since 4.8 set modifiable during creation - by default is true
        Parameters:
        modifiable - the modifiable to set