it.unimi.dsi.fastutil.objects
Interface ReferenceSet<K>

All Superinterfaces:
Collection<K>, Iterable<K>, ObjectIterable<K>, ReferenceCollection<K>, Set<K>
All Known Subinterfaces:
ReferenceSortedSet<K>
All Known Implementing Classes:
AbstractReferenceSet, AbstractReferenceSortedSet, ReferenceArraySet, ReferenceLinkedOpenHashSet, ReferenceOpenHashBigSet, ReferenceOpenHashSet, ReferenceSets.EmptySet, ReferenceSets.Singleton, ReferenceSets.SynchronizedSet, ReferenceSets.UnmodifiableSet, ReferenceSortedSets.EmptySet, ReferenceSortedSets.Singleton, ReferenceSortedSets.SynchronizedSortedSet, ReferenceSortedSets.UnmodifiableSortedSet

public interface ReferenceSet<K>
extends ReferenceCollection<K>, Set<K>

A type-specific Set; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens (again) iterator().

See Also:
Set

Method Summary
 ObjectIterator<K> iterator()
          Returns a type-specific iterator on the elements of this set.
 boolean remove(Object k)
          Removes an element from this set.
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ReferenceCollection
objectIterator, toArray
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

iterator

ObjectIterator<K> iterator()
Returns a type-specific iterator on the elements of this set.

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 Set.

Specified by:
iterator in interface Collection<K>
Specified by:
iterator in interface Iterable<K>
Specified by:
iterator in interface ObjectIterable<K>
Specified by:
iterator in interface ReferenceCollection<K>
Specified by:
iterator in interface Set<K>
Returns:
a type-specific iterator on the elements of this set.

remove

boolean remove(Object k)
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 Collection<K>
Specified by:
remove in interface Set<K>
See Also:
Collection.remove(Object)