Category: Collections-Sequenceable
Superclass: Magnitude
This class is an auxiliary class used to store information about a LargeArrayedCollection's contents. LargeArrayedCollections store their items non-contiguously in a separate storage object, and use a SortedCollection to map between indices in the array and indices in the storage object; instances of this class represent a block of indices that is stored contiguously in the storage object.

Method category index

instance creation (class)
accessing (instance)
comparing (instance)
modifying (instance)

instance creation (class)

first: first last: last index: index
Answer a LargeArraySubpart which answers first, last, and index when it is sent (respectively) #first, #last and #firstIndex.

top


accessing (instance)

first
Answer the index of the first item of the LargeArrayedCollection that the receiver refers to.

first: firstIndex last: lastIndex index: storagePosition

Set up the receiver so that it answers first, last, and index when it is sent (respectively) #first, #last and #firstIndex.

firstIndex

Answer the index in the collection's storage object of the first item of the LargeArrayedCollection that the receiver refers to.

last

Answer the index of the last item of the LargeArrayedCollection that the receiver refers to.

lastIndex

Answer the index in the collection's storage object of the last item of the LargeArrayedCollection that the receiver refers to.

top


comparing (instance)

< anObject
Answer whether the receiver points to a part of the array that is before anObject (this makes sense only if the receiver and anObject are two LargeArraySubparts referring to the same LargeArrayedCollection).

<= anObject

Answer whether the receiver points to a part of the array that is before anObject or starts at the same point (this makes sense only if the receiver and anObject are two LargeArraySubparts referring to the same LargeArrayedCollection).

= anObject

Answer whether the receiver and anObject are equal (assuming that the receiver and anObject are two LargeArraySubparts referring to the same LargeArrayedCollection, which the receiver cannot check for).

hash

Answer an hash value for the receiver

top


modifying (instance)

cutAt: position
Answer a new LargeArraySubpart whose lastIndex is position - 1, and apply a #removeFirst: to the receiver so that the firstIndex becomes position

grow

Add one to last and lastIndex

growBy: numberOfElements

Add numberOfElements to last and lastIndex

relocateTo: position

Move the firstIndex to position, and the lastIndex accordingly.

removeFirst: n

Sum n to first and firstIndex, but leave last/lastIndex untouched

removeLast: n

Subtract n from last and lastIndex, but leave first/firstIndex untouched

top