Abstract supertype of objects that contain other
values, called elements, where it is possible to
efficiently determine if a given value is an element.
Category
does not satisfy Container
, because it is
conceptually possible to have a Category
whose
emptiness cannot be computed.
The in
operator may be used to determine if a value
belongs to a Category
:
if ("hello" in "hello world") { ... } if (69 in 0..100) { ... } if (key->value in { for (n in 0..100) n.string->n**2 }) { ... }
Ordinarily, x==y
implies that x in cat == y in cat
.
But this contract is not required since it is possible
to form a meaningful Category
using a different
equivalence relation. For example, an IdentitySet
is
a meaningful Category
.
Methods | |
contains | Source Code Determines if the given value belongs to this
For most See also: containsEvery, containsAny |
containsAny | Source Code Determines if any one of the given values belongs
to this See also: contains |
containsEvery | Source Code Determines if every one of the given values belongs
to this See also: contains |
Inherited Methods |
Methods inherited from: Object |