File tom/behaviours


class tom.Comparable

Inherits

Behaviour supers
All

instance tom.Comparable

Inherits

Behaviour supers
All

methods

deferred int
  compare id other
pre
  other != nil;
Return 0 if the other is considered equal by the receiving object. 1 if the receiver considers himself larger, and -1 when smaller.


class tom.Container

A container is an object which gets to mark its elements after normal marking has been done. This is very usable for unique string tables, DO proxies, etc; actually: all cases where an object having become garbage implying it should be removed from its container, and the container itself is not allowed to reference the object in a normal way (since then it would never become garbage).

In short, a the combo of garbage collector and container implements weak referencing.

instance tom.Container

methods

deferred void
  gc_container_mark_elements;
The container mark method.

boolean
  isContainer;
Return TRUE iff the receiving object is a container.

void
  setIsContainer boolean container_p;
Set this object to be a container, or not, depending on container_p.


class tom.Copying

The Copying class defines an interface to copying objects.

Copying inherits from State since class objects should not be copyable. Inheriting from State ensures that the Copying instance methods can not be inherited by class objects.

Inherits

State supers
State

instance tom.Copying

methods

id
  copy;
Return a shallow copy of the receiving object.

id
  deepCopy;
Return a deep copy of the receiving object.

id
    deepen int level
  mutably: boolean mutable_p = NO;
Intended to be called on a recently acquired copy of an object, deepen mutable: deepens the copy. Iff the optional mutable_p is TRUE, the deepened copies will also be mutable. The default implementation does nothing.

The level should be less than 0 for an infinite deepen. length == 0 is a nop; iff length > 0, every element of the copy is copied and deepened with level - 1.

The value returned is self.

id
  initCopy;
Initialize the receiver just after it has been created as the result of a copy. The default implementation does nothing but return self.

id
  initAsCopyOf All other;
Initialize the receiver just after it has been created as the result of a mutableCopy of the other object. The default implementation does nothing but returning self.

_builtin_.Any
  mutableCopy;
Return a mutable (shallow) copy of the receiving object. For objects which do not discern between mutable and immutable variants, the default implementation returns [self copy].

Mutable copying asks the receiving object for its mutableCopyClass. If this class is isa, self is sent a copy. Otherwise, an instance of the class is allocated and sent an initAsCopyOf.

class (State)
  mutableCopyClass;
Return the class of the object resulting from a mutable copy of this object. The default implementation simply returns isa.


class tom.Enumerable

Inherits

State supers
State

methods

instance (id)
  withEnumerable Enumerable other;
Invoke self's withEnumerator with an enumerator from the other.

instance (id)
  withEnumerator Enumerator e;
Return a newly allocated instance of the receiving class, filled with the elements from the Enumerator e.

instance tom.Enumerable

methods

deferred protected id
  initWithEnumerator Enumerator e;
Initialize with the elements from the Enumerator e.

deferred Enumerator
  enumerator;
Return an Enumerator on the receiving object.


class tom.Enumerator

instance tom.Enumerator

methods

deferred (boolean, _builtin_.Any)
  next;
Return a tuple containing the next object, preceded by a boolean value indicating whether the end of the enumerable has been reached; if the boolean is TRUE, the end has not yet been reached.

(boolean, byte)
  next;
Default implementations for direct value retrieving enumerators.

(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.