File tom/collections


class tom.Collection

Inherits

State supers
State, Conditions, Copying, Enumerable

instance tom.Collection

methods

boolean
  dump_simple_p;
Return YES.

boolean
  equal id other;
Two collections consider themselves equal if they are the same object or when their elements are equal.

void
  freeze;
Make the receiving collection immutable. This is irreversible. It is a no-op for immutable collections.

Collection
  frozen;
Return self if this is a non-mutable Collection. Otherwise, return a non-mutable collection with the same contents.

_builtin_.Any
  member All object;
Return the element contained in this collection, which is equal to the object. The default implementation by Collection visits the elements using an enumerator.

_builtin_.Any
  memq All object;
Like member, but the element is identified on reference equality.

deferred int
  length;
Return the number of elements in this Collection.

void
  makeElementsPerform Invocation invocation;
Fire the invocation at the elements contained in the receiving collection.

void
  makeElementsPerform selector message;
Send the argumentless message to the elements contained in the receiving collection.

void
  makeElementsPerform selector message
                 with All argument;
Send the message with the object argument to the elements contained in the receiving collection.

boolean
  mutable;
A Collection is not mutable.

void
  passElementsTo Invocation inv;
Fire the invocation repeatedly, each time with the next object from the collection completing the invocation.

OutputStream
  write OutputStream s;
Undocumented.


class tom.MutableCollection

Inherits

State supers
Collection

instance tom.MutableCollection

methods

deferred void
  add All object;
Undocumented.

void
  addElementsFrom Enumerable other;
Undocumented.

void
  addElementsFromEnumerator Enumerator e;
Undocumented.

deferred void
  empty;
Remove all elements from the receiving collection.

deferred void
  freeze;
Force freeze to be undefined since each particular subclass must itself implement it.

id (self)
  initWithEnumerator Enumerator e;
Initialize by feeding self the elements from the enumerator.

boolean
  mutable;
A MutableCollection is mutable.


class tom.Keyed

A Keyed Collection stores elements on a key.

Inherits

State supers
Collection

instance tom.Keyed

methods

deferred _builtin_.Any
  at All key
pre
  key != nil;
Undocumented.


class tom.MutableKeyed

Inherits

State supers
Keyed, MutableCollection

instance tom.MutableKeyed

methods

deferred void
  add All object;
Add the object.

deferred void
  remove All object;
Remove the object.


class tom.Mapped

A Mapped Collection is a Keyed collection which stores (key, value) associations.

Inherits

State supers
Keyed

instance tom.Mapped

methods

boolean
  equal id other;
Check not only the values, but also the keys.

deferred Enumerator
  keyEnumerator;
Return an enumerator on the keys of this mapped collection.


class tom.MutableMapped

Inherits

State supers
Mapped, MutableKeyed

instance tom.MutableMapped

methods

void
  add All value;
Undocumented.

deferred void
  set All value
   at All key
pre
  key != nil && value != nil;
Undocumented.


class tom.Ordered

A Ordered Collection maintains its elements in a specific order, though the time complexity or retrieving the nth object not necessarily independent of n.

Inherits

State supers
Collection

instance tom.Ordered


class tom.MutableOrdered

Inherits

State supers
Ordered, MutableCollection

instance tom.MutableOrdered


class tom.Indexed

An Indexed Collection maintains an association between integer indices and the objects it contains, with the promise that retrieving an object through the index is O(1) in time complexity.

Inherits

State supers
Ordered

instance tom.Indexed

methods

(int, int)
  adjustRange (int, int) (start, len);
Adjust the range (start, len) to fit the length of the receiving Indexed collection.

deferred _builtin_.Any
  at int index;
Return the element at index. If the receiving collection stores unboxed values, such as integers, the value returned is the element boxed.

byte
  at int index;
Return the byte value of the element at index. If the receiving collection stores objects, the byteValue of the element retrieved is actually returned.

char
  at int index;
The following all follow the at stanza.

int
  at int index;
Undocumented.

long
  at int index;
Undocumented.

float
  at int index;
Undocumented.

double
  at int index;
Undocumented.

dynamic
  elements;
Extract the elements from the receiving collection, as indicated by the return type. The number of elements in the collection must match the number of expected elements.

dynamic
  elements (int, int) (start, num);
Like elements, but extract only the num elements starting at index start.

Enumerator
  enumerator;
Return an Enumerator on this Indexed.

boolean
  equal id other;
A faster implementation than the one inherited from Collection.

int
  indexOf All element;
Return the index of the first element, or -1 if it could not be found.

int
  indexOfIdentical All element;
Return the index of the first identical element, or -1 if it could not be found.

Performing

void
  makeElementsPerform Invocation inv;
A faster implementation than the one inherited from Collection, without using an Enumerator.

void
  makeElementsPerform selector message;
Likewise.

void
  makeElementsPerform selector message
                 with All argument;
Likewise.

void
  passElementsTo Invocation inv;
Likewise.


class tom.MutableIndexed

Inherits

State supers
Indexed, MutableOrdered

instance tom.MutableIndexed

methods

deferred void
  set All object
   at int index;
Store the object at index in the receiving collection.

deferred void
  swap (int, int) (i, j);
Swap the elements at the indices i and j.

void
  reverse (int, int) (start, len);
Reverse the elements in the range starting at start, with length len.

deferred void
  removeElementAt int index;
Remove the element at index, decreasing by 1 the indices of the elements further in the collection.

void
  removeElement All element;
Remove the first occurence of element.

void
  removeIdenticalElement All element;
Remove the first occurence of the identical element.


class tom.IndexedEnumerator

The IndexedEnumerator enumerates any Indexed collection, returning the elements boxed.

Inherits

State supers
State, Enumerator

methods

instance (id)
  with Indexed indexed;
Undocumented.

instance tom.IndexedEnumerator

variables

int next;
The index of the next element to be returned.
int num;
The index one beyond the last element to be returned.
Indexed indexed;
The actual indexed collection.

methods

id (self)
    init Indexed a
  start: int start = 0
  length int length;
Designated initializer.

(boolean, _builtin_.Any)
  next;
Undocumented.

(boolean, byte)
  next;
All these next methods are not really necessary, as they are provided by the Enumerator behaviour. However, binding them here directly greatly enhances speed and reduces memory requirements for non-object indexeds, which now also do not need their own enumerator to obtain speed.

(boolean, char)
  next;
Undocumented.

(boolean, int)
  next;
Undocumented.

(boolean, long)
  next;
Undocumented.

(boolean, float)
  next;
Undocumented.

(boolean, double)
  next;
Undocumented.


Generated by tm 1.01.