eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'VirtualArrayWithCache':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: VirtualArrayWithCache


Inheritance:

   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

Description:


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:]


Related information:



Instance protocol:

collection protocol
o  at: index


Examples:


    |factorialLines|

    factorialLines := VirtualArrayWithCache new:10000.
    factorialLines generator:[:index | index factorial printString].
    factorialLines at:1000.
    factorialLines at:1000.
    factorialLines at:10000.
    


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 01:28:14 GMT