|
Class: VirtualArrayWithCache
Object
|
+--Collection
|
+--SequenceableCollection
|
+--VirtualArray
|
+--VirtualArrayWithCache
- Package:
- stx:libbasic2
- Category:
- Collections-Arrayed
- Version:
- rev:
1.2
date: 2019/05/30 09:35:20
- user: cg
- file: VirtualArrayWithCache.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
- Author:
- Claus Gittinger
like a VirtualArray, but caches the results of the last few accesses.
This might behave better, if it is expensive to compute the elements,
and they are often accessed repeatedly (as when showing in a listView).
[instance variables:]
[class variables:]
collection protocol
-
at: index
-
|factorialLines|
factorialLines := VirtualArrayWithCache new:10000.
factorialLines generator:[:index | index factorial printString].
factorialLines at:1000.
factorialLines at:1000.
factorialLines at:10000.
|
|