Changes between Version 1 and Version 2 of immutablelist


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

--

Legend:

Unmodified
Added
Removed
Modified
  • immutablelist

    v1 v2  
    88As 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.
    99
    10 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.
     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. Therefore ImmutableList uses BigInteger for indexing.
    1111
     12The main classes here are
     13
     14|| * class * || * function * ||
     15|| ImmutableList || interface, providing get(BigInteger) and size() and being Iterable ||
     16|| AbstractImmutableList || abstract superclass with default iterator() implementation, toString and get(long) ||
     17|| JoinedList || Joins 2 immutablelists into one. ||
     18
     19