An identity set implemented as a hash set stored in an
Array
of singly linked lists. The hash code of an
element is defined by identityHash()
. Note that an
IdentitySet
is not a Set
, since it does not obey the
semantics of a Set
. In particular, it may contain
multiple elements which are equal, as determined by the
==
operator.
no subtypes hierarchy
Initializer |
IdentitySet(Hashtable hashtable = ..., {Element*} elements = ...) Parameters:
|
Attributes | |
hash | Source Codeshared actual Integer hash The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:
Therefore, a class which refines |
size | Source Codeshared actual Integer size The number of elements returned by the Refines Iterable.size |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Collection<Element> |
Attributes inherited from: Iterable<Element,Absent> |
Methods | |
add | Source Codeshared Boolean add(Element element) |
addAll | Source Codeshared Boolean addAll({Element*} elements) |
clear | Source Codeshared void clear() Removes every element |
clone | Source Codeshared actual IdentitySet<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. Refines Collection.clone |
complement | Source Codeshared IdentitySet<Element> complement<Other>(IdentitySet<Other> set) |
contains | Source Codeshared actual Boolean contains(Object element) Returns For most
However, it is possible to form a useful |
count | Source Codeshared actual Integer count(Boolean selecting(Element element)) Produces the number of elements in this stream that
satisfy the given predicate function ( Refines Iterable.count |
equals | Source Codeshared actual Boolean equals(Object that) Determine if two values are equal. Implementations should respect the constraints that:
Furthermore it is recommended that implementations
ensure that if A class which explicitly refines |
exclusiveUnion | Source Codeshared IdentitySet<Element|Other> exclusiveUnion<Other>(IdentitySet<Other> set) |
intersection | Source Codeshared IdentitySet<Element&Other> intersection<Other>(IdentitySet<Other> set) |
iterator | Source Codeshared actual Iterator<Element> iterator() An iterator for the elements belonging to this stream. Refines Iterable.iterator |
remove | Source Codeshared Boolean remove(Element element) |
removeAll | Source Codeshared Boolean removeAll({Element*} elements) |
subset | Source Codeshared default Boolean subset<Other>(IdentitySet<Other> set) |
superset | Source Codeshared default Boolean superset<Other>(IdentitySet<Other> set) |
union | Source Codeshared IdentitySet<Element|Other> union<Other>(IdentitySet<Other> set) |
Inherited Methods |
Methods inherited from: Category<Element> |
Methods inherited from: Collection<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() |