Changes between Initial Version and Version 1 of immutablelist


Ignore:
Timestamp:
10/17/19 16:09:56 (5 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • immutablelist

    v1 v1  
     1= ImmutableList
     2
     3ImmutableList is similar to the common java.util.List: it contains a list of elements.
     4However, the big differences are
     5 * ImmutableList is immutable, so it can not be modified
     6 * ImmutableList is generating elements on request only, and does not keep the elements.
     7
     8As a simple comparison, suppose you need a list of all integers between 1000 and 2000. You could write a loop to fill 1000 elements of an ArrayList. Alternatively, you can create an ImmutableList instance where get(n) creates and returns the expected element on request.
     9
     10This mechanism is especially useful when large lists are used, or when you already know that the user of the list will only pick a few items from the list, or even just wants to know the size of the list.
     11