Documentation Set for Swarm 2.2
Prev | Reference II. Collections Library | Next

# Set

## Name

Set -- Collection of members each having a defined identity.

## Description

Set is a subtype of KeyedCollection in which the key value associated with each member is determined by the member value itself. The key value may be identical to the member itself, or may be defined as a a function of the member using a create-time option.

The Set type inherits most of its interface from the KeyedCollection supertype. Set defines no create-time options beyond those already defined by KeyedCollection. If a custom compare or bucket function is specified, the member value is passed as the key value arguments of these functions. These functions determine what part of the member value is part of the key value, by determining which key values will compare equal to any member.

## Protocols adopted by Set

Set KeyedCollection CREATABLE

## Methods

### Phase: Using

- - replace: anObject
  The replace: message replaces a member stored at a given key with another member value that matches the same key. The new value to replace the existing one is passed as the argument. replace: returns the member value that was replaced, or nil if the collection contained no member with a matching key.

- - (BOOL)add: anObject
  The add: message adds a new member to a set.

Prev | Home | Next
PermutedIndex | Up | String