|
Class: VirtualArray
Object
|
+--Collection
|
+--SequenceableCollection
|
+--VirtualArray
- Package:
- stx:libbasic2
- Category:
- Collections-Arrayed
- Version:
- rev:
1.9
date: 2017/02/22 18:02:05
- user: cg
- file: VirtualArray.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
- Author:
- Claus Gittinger
An Array which computes its values on demand and does NOT remember those values.
Use this to present huge files/hex dumps to a text editor.
LazyArray
accessing
-
generator
-
the element value generator; a block which gets the index as argument
-
generator: aBlock
-
set the element value generator; a block which gets the index as argument
-
setSize: anInteger
-
-
size
-
the virtual size
collection protocol
-
at: index
-
(comment from inherited method)
return the indexed instance variable with index, anInteger;
this method can be redefined in subclasses.
-
at: index put: value
-
(comment from inherited method)
store the 2nd arg, anObject as indexed instvar with index, anInteger.
this method can be redefined in subclasses. Returns anObject (sigh)
-
grow: howBig
-
change the receiver's size
inspecting
-
displayOn: aGCOrStream
-
print a representation of the receiver on aGCOrStream for display in inspectors etc.
queries
-
species
-
return the type of collection to be returned by collect, select etc.
|squaresLines|
squaresLines := VirtualArray new.
squaresLines generator:[:index | index squared printString].
squaresLines setSize:100000.
squaresLines inspect.
TextView openWith:squaresLines
|
|