Interface Iterables.Cached<A>

Type Parameters:
A - the element type
All Superinterfaces:
Collection<A>, Iterable<A>, List<A>, SequencedCollection<A>
Enclosing class:
Iterables

public static interface Iterables.Cached<A> extends List<A>
A list that is populated lazily on demand.
  • Method Details

    • source

      Iterable<A> source()
      Returns the source from which this list is populated.
      Returns:
      the source from which this list is populated
    • force

      List<A> force()
      Populates this list completely, and returns an efficient view.

      If this list is already populated completely, nothing happens.

      Returns:
      an unmodifiable view on this list with efficient access
      See Also:
    • isComplete

      boolean isComplete()
      Checks whether this list has been completely populated.

      A positive result can be due to a preceding call to force(), due to iterating the list exhaustively, or due to a whole-list operation such as List.size().

      Returns:
      true if this list is completely populated; false if there are elements left to draw from the source on demand
      See Also: