Class AbstractLazyLoadList<E>

java.lang.Object
org.datanucleus.store.query.AbstractLazyLoadList<E>
Type Parameters:
E - Type of the element of this list
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>
Direct Known Subclasses:
AbstractCandidateLazyLoadList

public abstract class AbstractLazyLoadList<E> extends Object implements List<E>
Abstract implementation of a lazy loaded list of (persistent) objects. Needs to be extended to implement the retrieveObjectForIndex() method to retrieve the object at the specified index from whatever datasource is being used, and to implement the getSize() method to return the size of the list. The "datasource" could be results for a query, or a connection to a datastore, or whatever ... just a source of objects. TODO Change Localised message numbers to be generic
  • Field Details

    • itemsByIndex

      private Map<Integer,E> itemsByIndex
      Map of object, keyed by the index (0, 1, etc).
    • size

      protected int size
      Cached size of the list. -1 when not known.
  • Constructor Details

    • AbstractLazyLoadList

      public AbstractLazyLoadList(String cacheType)
      Constructor for a lazy load list.
      Parameters:
      cacheType - Type of caching of objects in the list
  • Method Details