8.61. File tom/Queue

class tom.Queue

The abstract Queue class. There is not much you can do with it as queue has to be mutable to do anything useful.

inherits

State supers: Indexed

instance tom.Queue

methods


boolean
  queuep;

Return TRUE.


deferred boolean
  emptyp;

Return TRUE for empty queues.

class tom.MutableQueue

inherits

State supers: Queue, MutableIndexed

instance tom.MutableQueue

methods


deferred void
  add Any object;

Push an object to the head of the queue.


deferred Any
  pop;

Pop the object from the tail of the queue.

class tom.MutableObjectQueue

inherits

State supers: MutableQueue, Conditions

instance tom.MutableObjectQueue

variables

int offset;

The index into the contents of the element self[0].

int elements;

The number of elements.

MutableObjectArray contents;

The array holding the actual objects.

methods


Any
  at int index
pre
  index >= 0 && index < elements;

Undocumented.


void
  set All object
   at int index
pre
  index >= 0 && index < elements;

Undocumented.


int
  length;

Undocumented.


void
  add Any object;

Add the object to the end.


boolean
  emptyp;

Undocumented.


Any
  pop;

Retrieve the object at self[0] and remove it. All in constant time, of course.


id (self)
  empty;

Make the queue empty.