Collection.st
changeset 9410 4baf189ccf3d
parent 9404 f0416ce9d6a2
child 9842 7deebdffbced
equal deleted inserted replaced
9409:4be6cc96f1c0 9410:4baf189ccf3d
  1349     ^ assocs.
  1349     ^ assocs.
  1350 
  1350 
  1351     "
  1351     "
  1352      #(10 20 30 40 50 60) keysAndValues
  1352      #(10 20 30 40 50 60) keysAndValues
  1353     "
  1353     "
       
  1354 !
       
  1355 
       
  1356 literalArrayEncoding
       
  1357     "encode myself as an array literal, from which a copy of the receiver
       
  1358      can be reconstructed with #decodeAsLiteralArray."
       
  1359 
       
  1360     |encoding idx|
       
  1361 
       
  1362     encoding := Array new:self size + 1.
       
  1363     encoding at:1 put:self class name.
       
  1364     idx := 2.
       
  1365     self do:[:element|
       
  1366 	encoding at:idx put:element literalArrayEncoding.
       
  1367 	idx := idx + 1.
       
  1368     ].
       
  1369     ^ encoding
       
  1370 
       
  1371 
       
  1372     "
       
  1373      (Array with:(Color red:50 green:50 blue:50)
       
  1374 	    with:(1 @ 2)
       
  1375      ) literalArrayEncoding decodeAsLiteralArray
       
  1376     "
       
  1377 
       
  1378     "Modified: 22.4.1996 / 13:00:56 / cg"
  1354 !
  1379 !
  1355 
  1380 
  1356 readStream
  1381 readStream
  1357     "return a stream for reading from the receiver"
  1382     "return a stream for reading from the receiver"
  1358 
  1383 
  2960 ! !
  2985 ! !
  2961 
  2986 
  2962 !Collection class methodsFor:'documentation'!
  2987 !Collection class methodsFor:'documentation'!
  2963 
  2988 
  2964 version
  2989 version
  2965     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.192 2006-06-30 07:57:58 stefan Exp $'
  2990     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.193 2006-07-03 16:08:43 stefan Exp $'
  2966 ! !
  2991 ! !
  2967 
  2992 
  2968 Collection initialize!
  2993 Collection initialize!