CeylonCollection(JCollection<out Element> collection)
sizeSource Codeshared actual default Integer size

The number of elements returned by the iterator of this stream, if the iterator terminates. In the case of an infinite stream, this operation never terminates.

Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Collection<Element>
Attributes inherited from: Iterable<Element,Absent>
cloneSource Codeshared actual default Collection<Element> clone()

A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned.

containsSource Codeshared actual default Boolean contains(Object element)

Returns true if the given value belongs to this Category, that is, if it is an element of this Category, or false otherwise.

For any instance c of Category, c.contains(element) may be written using the in operator:

element in c

For most Categorys, the following relationship is satisfied by every pair of elements x and y:

  • if x==y, then x in category == y in category

However, it is possible to form a useful Category consistent with some other equivalence relation, for example ===. Therefore implementations of contains() which do not satisfy this relationship are tolerated.

Refines Collection.contains ultimately refines Category.contains
iteratorSource Codeshared actual default Iterator<Element> iterator()

An iterator for the elements belonging to this stream.

If this is a nonempty stream with type {Element+}, the iterator must produce at least one element.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Category<Element>
Methods inherited from: Collection<Element>
Methods inherited from: Iterable<Element,Absent>