it.unimi.dsi.fastutil.objects
Interface ReferenceCollection<K>
- All Superinterfaces:
- Collection<K>, Iterable<K>, ObjectIterable<K>
- All Known Subinterfaces:
- ReferenceBigList<K>, ReferenceList<K>, ReferenceSet<K>, ReferenceSortedSet<K>
- All Known Implementing Classes:
- AbstractByte2ReferenceSortedMap.ValuesCollection, AbstractChar2ReferenceSortedMap.ValuesCollection, AbstractDouble2ReferenceSortedMap.ValuesCollection, AbstractFloat2ReferenceSortedMap.ValuesCollection, AbstractInt2ReferenceSortedMap.ValuesCollection, AbstractLong2ReferenceSortedMap.ValuesCollection, AbstractObject2ReferenceSortedMap.ValuesCollection, AbstractReference2BooleanSortedMap.KeySet, AbstractReference2ByteSortedMap.KeySet, AbstractReference2CharSortedMap.KeySet, AbstractReference2DoubleSortedMap.KeySet, AbstractReference2FloatSortedMap.KeySet, AbstractReference2IntSortedMap.KeySet, AbstractReference2LongSortedMap.KeySet, AbstractReference2ObjectSortedMap.KeySet, AbstractReference2ReferenceSortedMap.KeySet, AbstractReference2ReferenceSortedMap.ValuesCollection, AbstractReference2ShortSortedMap.KeySet, AbstractReferenceBigList, AbstractReferenceBigList.ReferenceSubList, AbstractReferenceCollection, AbstractReferenceList, AbstractReferenceList.ReferenceSubList, AbstractReferenceSet, AbstractReferenceSortedSet, AbstractShort2ReferenceSortedMap.ValuesCollection, ReferenceArrayList, ReferenceArraySet, ReferenceBigArrayBigList, ReferenceBigLists.EmptyBigList, ReferenceBigLists.ListBigList, ReferenceBigLists.Singleton, ReferenceBigLists.SynchronizedBigList, ReferenceBigLists.UnmodifiableBigList, ReferenceCollections.EmptyCollection, ReferenceCollections.IterableCollection, ReferenceCollections.SynchronizedCollection, ReferenceCollections.UnmodifiableCollection, ReferenceLinkedOpenHashSet, ReferenceLists.EmptyList, ReferenceLists.Singleton, ReferenceLists.SynchronizedList, ReferenceLists.UnmodifiableList, ReferenceOpenHashBigSet, ReferenceOpenHashSet, ReferenceSets.EmptySet, ReferenceSets.Singleton, ReferenceSets.SynchronizedSet, ReferenceSets.UnmodifiableSet, ReferenceSortedSets.EmptySet, ReferenceSortedSets.Singleton, ReferenceSortedSets.SynchronizedSortedSet, ReferenceSortedSets.UnmodifiableSortedSet
public interface ReferenceCollection<K>
- extends Collection<K>, ObjectIterable<K>
A type-specific Collection
; provides some additional methods
that use polymorphism to avoid (un)boxing.
Additionally, this class defines strengthens (again) iterator()
and defines
a slightly different semantics for toArray(Object[])
.
- See Also:
Collection
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray |
iterator
ObjectIterator<K> iterator()
- 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 Collection<K>
- Specified by:
iterator
in interface Iterable<K>
- Specified by:
iterator
in interface ObjectIterable<K>
- Returns:
- a type-specific iterator on the elements of this collection.
objectIterator
@Deprecated
ObjectIterator<K> objectIterator()
- Deprecated. As of
fastutil
5, replaced by iterator()
.
- Returns a type-specific iterator on this elements of this collection.
- See Also:
iterator()
toArray
<T> T[] toArray(T[] a)
- Returns an containing the items of this collection;
the runtime type of the returned array is that of the specified array.
Warning: Note that, contrarily to Collection.toArray(Object[])
, this
methods just writes all elements of this collection: no special
value will be added after the last one.
- Specified by:
toArray
in interface Collection<K>
- Parameters:
a
- if this array is big enough, it will be used to store this collection.
- Returns:
- a primitive type array containing the items of this collection.
- See Also:
Collection.toArray(Object[])
Copyright © 2011. All Rights Reserved.