RunArray.st
changeset 871 b44445dc4ac6
parent 630 55973d9fee59
child 892 90a4022c52a1
equal deleted inserted replaced
870:452fc695de34 871:b44445dc4ac6
   244     "
   244     "
   245      RunArray new:100 withAll:#hello
   245      RunArray new:100 withAll:#hello
   246     "
   246     "
   247 
   247 
   248     "Modified: / 30.10.1997 / 14:36:38 / cg"
   248     "Modified: / 30.10.1997 / 14:36:38 / cg"
       
   249 !
       
   250 
       
   251 runs:runs values:values
       
   252     "return a new runArray, containing elements defined by pairs from
       
   253      runs and values"
       
   254 
       
   255     ^ self basicNew setElementsFromRuns:runs values:values
       
   256 
       
   257     "
       
   258      RunArray runs:#(2 3 4) values:#($a $b $c)
       
   259     "
   249 ! !
   260 ! !
   250 
   261 
   251 !RunArray methodsFor:'accessing'!
   262 !RunArray methodsFor:'accessing'!
   252 
   263 
   253 at:index 
   264 at:index 
   964     "
   975     "
   965      RunArray from:#(1 2 3 3 3 4 5 5 6 6 6 6 6 6)
   976      RunArray from:#(1 2 3 3 3 4 5 5 6 6 6 6 6 6)
   966     "
   977     "
   967 
   978 
   968     "Modified: / 7.4.1998 / 09:33:57 / cg"
   979     "Modified: / 7.4.1998 / 09:33:57 / cg"
       
   980 !
       
   981 
       
   982 setElementsFromRuns:runs values:values
       
   983     |idx|
       
   984 
       
   985     contentsArray := Array new:(runs size * 2).
       
   986     idx := 1.
       
   987     runs with:values do:[:length :value |
       
   988         contentsArray at:idx put:length.
       
   989         contentsArray at:idx+1 put:value.
       
   990         idx := idx + 2.
       
   991     ].
   969 ! !
   992 ! !
   970 
   993 
   971 !RunArray methodsFor:'searching'!
   994 !RunArray methodsFor:'searching'!
   972 
   995 
   973 findFirst:aBlock
   996 findFirst:aBlock
  1120 ! !
  1143 ! !
  1121 
  1144 
  1122 !RunArray class methodsFor:'documentation'!
  1145 !RunArray class methodsFor:'documentation'!
  1123 
  1146 
  1124 version
  1147 version
  1125     ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.14 1998-04-07 07:52:08 cg Exp $'
  1148     ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.15 2000-01-22 19:29:13 cg Exp $'
  1126 ! !
  1149 ! !