Represents an iterable collection of elements of finite
size, with a well-defined notion of value equality.
Collection is the abstract supertype of List,
Map, and Set.
A Collection forms a Category of its elements, and
is Iterable. The elements of a collection are not
necessarily distinct when compared using Object.equals().
A Collection may be cloned. If a collection is
immutable, it is acceptable that clone() produce a
reference to the collection itself. If a collection is
mutable, clone() should produce a collection containing
references to the same elements, with the same structure as
the original collection—that is, it should produce a
shallow copy of the collection.
All Collections are required to support a well-defined
notion of value equality, but the
definition of equality depends upon the kind of collection.
Equality for Maps and Sets has a quite different
definition to equality for Lists.
no type hierarchy
| Attributes | |
empty | Source Codeshared actual default Boolean emptyDetermine if the collection is empty, that is, if it has no elements. Refines Iterable.empty |
string | Source Codeshared actual default String stringA string of form |
| Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Iterable<Element,Absent> |
| Methods | |
clone | Source Codeshared formal 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. |
contains | Source Codeshared actual default Boolean contains(Object element)Return |
| Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Category<Element> |
Methods inherited from: Iterable<Element,Absent>Iterable.any(), Iterable.by(), Iterable.chain(), Iterable.collect(), Iterable.count(), Iterable.defaultNullElements(), Iterable.every(), Iterable.filter(), Iterable.find(), Iterable.findLast(), Iterable.flatMap(), Iterable.fold(), Iterable.follow(), Iterable.getFromFirst(), Iterable.interpose(), Iterable.iterator(), Iterable.longerThan(), Iterable.map(), Iterable.max(), Iterable.partition(), Iterable.product(), Iterable.reduce(), Iterable.repeat(), Iterable.scan(), Iterable.select(), Iterable.sequence(), Iterable.shorterThan(), Iterable.skip(), Iterable.skipWhile(), Iterable.sort(), Iterable.spread(), Iterable.take(), Iterable.takeWhile() |