Squeak Class Documentation category index | class index  
 
ArrayedCollection
  category: Collections-Abstract
  superclass: SequenceableCollection
  subclasses: DirectoryEntry SoundBuffer String WordArray RunArray Array ShortIntegerArray B3DPrimitiveVertexArray Bitmap FloatArray Text ShortRunArray ByteArray Array2D TranslatedMethod IntegerArray Pixmap ColorArray

I am an abstract collection of elements with a fixed range of integers (from 1 to n>=1) as external keys.

instance methods
  accessing
  size

  adding
  add:

  filter streaming
  flattenOnStream:

  objects from disk
  restoreEndianness
swapBytesFrom:to:
swapHalves
writeOn:
writeOnGZIPByteStream:

  printing
  storeOn:

  private
  defaultElement
storeElementsFrom:to:on:

  sorting
  asSortedArray
isSorted
isSortedBy:
mergeFirst:middle:last:into:by:
mergeSortFrom:to:by:
mergeSortFrom:to:src:dst:by:
sort
sort:

class methods
  instance creation
  new
new:withAll:
newFrom:
newFromStream:
with:
with:with:
with:with:with:
with:with:with:with:
with:with:with:with:with:
with:with:with:with:with:with:
withAll:

  plugin generation
  ccg:generateCoerceToOopFrom:on:
ccg:generateCoerceToValueFrom:on:

instance methods
  accessing top  
 

size

Answer how many elements the receiver contains.


  adding top  
 

add:

Include newObject as one of the receiver's elements. Answer newObject.
ArrayedCollections cannot respond to this message.


  filter streaming top  
 

flattenOnStream:


  objects from disk top  
 

restoreEndianness

This word object was just read in from a stream. It was stored in Big Endian (Mac) format. Reverse the byte order if the current machine is Little Endian.
We only intend this for non-pointer arrays. Do nothing if I contain pointers.


 

swapBytesFrom:to:

Perform a bigEndian/littleEndian byte reversal of my words.
We only intend this for non-pointer arrays. Do nothing if I contain pointers.


 

swapHalves

A normal switch in endianness (byte order in words) reverses the order of 4 bytes. That is not correct for SoundBuffers, which use 2-bytes units. If a normal switch has be done, this method corrects it further by swapping the two halves of the long word.
This method is only used for 16-bit quanities in SoundBuffer, ShortIntegerArray, etc.


 

writeOn:

Store the array of bits onto the argument, aStream. (leading byte ~= 16r80) identifies this as raw bits (uncompressed). Always store in Big Endian (Mac) byte order. Do the writing at BitBlt speeds. We only intend this for non-pointer arrays. Do nothing if I contain pointers.


 

writeOnGZIPByteStream:

We only intend this for non-pointer arrays. Do nothing if I contain pointers.


  printing top  
 

storeOn:

Refer to the comment in Object|storeOn:.


  private top  
 

defaultElement


 

storeElementsFrom:to:on:


  sorting top  
 

asSortedArray

Return a copy of the receiver in sorted order, as an Array. 6/10/96 sw


 

isSorted

Return true if the receiver is sorted by the given criterion.
Optimization for isSortedBy: [:a :b | a <= b].


 

isSortedBy:

Return true if the receiver is sorted by the given criterion.


 

mergeFirst:middle:last:into:by:

Private. Merge the sorted ranges [first..middle] and [middle+1..last]
of the receiver into the range [first..last] of dst.


 

mergeSortFrom:to:by:

Sort the given range of indices using the mergesort algorithm.
Mergesort is a worst-case O(N log N) sorting algorithm that usually
does only half as many comparisons as heapsort or quicksort.


 

mergeSortFrom:to:src:dst:by:

Private. Split the range to be sorted in half, sort each half, and
merge the two half-ranges into dst.


 

sort

Sort this array into ascending order using the '<=' operator.


 

sort:

Sort this array using aSortBlock. The block should take two arguments
and return true if the first element should preceed the second one.


class methods
  instance creation top  
 

new

Answer a new instance of me, with size = 0.


 

new:withAll:

Answer an instance of me, with number of elements equal to size, each
of which refers to the argument, value.


 

newFrom:

Answer an instance of me containing the same elements as aCollection.


 

newFromStream:

Only meant for my subclasses that are raw bits and word-like. For quick unpack form the disk.


 

with:

Answer a new instance of me, containing only anObject.


 

with:with:

Answer a new instance of me, containing firstObject and secondObject.


 

with:with:with:

Answer a new instance of me, containing only the three arguments as
elements.


 

with:with:with:with:

Answer a new instance of me, containing only the three arguments as
elements.


 

with:with:with:with:with:

Answer a new instance of me, containing only the five arguments as
elements.


 

with:with:with:with:with:with:

Answer a new instance of me, containing only the 6 arguments as elements.


 

withAll:

Create a new collection containing all the elements from aCollection.


  plugin generation top  
 

ccg:generateCoerceToOopFrom:on:


 

ccg:generateCoerceToValueFrom:on: