it.unimi.dsi.fastutil.objects
Class AbstractReferenceSet<K>
java.lang.Object
java.util.AbstractCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceCollection<K>
it.unimi.dsi.fastutil.objects.AbstractReferenceSet<K>
- All Implemented Interfaces:
- ObjectIterable<K>, ReferenceCollection<K>, ReferenceSet<K>, Cloneable, Iterable<K>, Collection<K>, Set<K>
- Direct Known Subclasses:
- AbstractReferenceSortedSet, ReferenceArraySet, ReferenceOpenHashBigSet, ReferenceOpenHashSet, ReferenceSets.Singleton
public abstract class AbstractReferenceSet<K>
- extends AbstractReferenceCollection<K>
- implements Cloneable, ReferenceSet<K>
An abstract class providing basic methods for sets implementing a type-specific interface.
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray |
AbstractReferenceSet
protected AbstractReferenceSet()
iterator
public abstract ObjectIterator<K> iterator()
- Description copied from interface:
ReferenceCollection
- Returns a type-specific iterator on the elements of this collection.
Note that this specification strengthens the one given in
Iterable.iterator()
, which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection
.
- Specified by:
iterator
in interface ObjectIterable<K>
- Specified by:
iterator
in interface ReferenceCollection<K>
- Specified by:
iterator
in interface ReferenceSet<K>
- Specified by:
iterator
in interface Iterable<K>
- Specified by:
iterator
in interface Collection<K>
- Specified by:
iterator
in interface Set<K>
- Specified by:
iterator
in class AbstractReferenceCollection<K>
- Returns:
- a type-specific iterator on the elements of this collection.
equals
public boolean equals(Object o)
- Specified by:
equals
in interface Collection<K>
- Specified by:
equals
in interface Set<K>
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Returns a hash code for this set.
The hash code of a set is computed by summing the hash codes of
its elements.
- Specified by:
hashCode
in interface Collection<K>
- Specified by:
hashCode
in interface Set<K>
- Overrides:
hashCode
in class Object
- Returns:
- a hash code for this set.
remove
public boolean remove(Object k)
- Description copied from interface:
ReferenceSet
- Removes an element from this set.
Note that the corresponding method of the type-specific collection is rem()
.
This unfortunate situation is caused by the clash
with the similarly named index-based method in the List
interface.
- Specified by:
remove
in interface ReferenceSet<K>
- Specified by:
remove
in interface Collection<K>
- Specified by:
remove
in interface Set<K>
- Overrides:
remove
in class AbstractCollection<K>
- See Also:
Collection.remove(Object)
Copyright © 2011. All Rights Reserved.