Changes between Version 8 and Version 9 of immutablelist


Ignore:
Timestamp:
08/03/20 09:43:28 (4 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • immutablelist

    v8 v9  
    2828As 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.
    2929
    30 This 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. Therefore ImmutableList uses BigInteger for indexing.
     30ImmutableList uses BigInteger for indexing to support unlimited list sizes.
     31
     32This mechanism is especially useful when the list elements have to be generated on an as-needed basis. For example when large lists are used, when the list elements are expensive to create, 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.
    3133
    3234The main classes here are