it.unimi.dsi.fastutil.floats
Interface FloatCollection

All Superinterfaces:
java.util.Collection<java.lang.Float>, FloatIterable, java.lang.Iterable<java.lang.Float>
All Known Subinterfaces:
FloatBigList, FloatList, FloatSet, FloatSortedSet
All Known Implementing Classes:
AbstractFloatBigList, AbstractFloatBigList.FloatSubList, AbstractFloatCollection, AbstractFloatList, AbstractFloatList.FloatSubList, AbstractFloatSet, AbstractFloatSortedSet, FloatArrayList, FloatArraySet, FloatAVLTreeSet, FloatBigArrayBigList, FloatBigLists.EmptyBigList, FloatBigLists.ListBigList, FloatBigLists.Singleton, FloatBigLists.SynchronizedBigList, FloatBigLists.UnmodifiableBigList, FloatCollections.EmptyCollection, FloatCollections.IterableCollection, FloatCollections.SynchronizedCollection, FloatCollections.UnmodifiableCollection, FloatLinkedOpenCustomHashSet, FloatLinkedOpenHashSet, FloatLists.EmptyList, FloatLists.Singleton, FloatLists.SynchronizedList, FloatLists.UnmodifiableList, FloatOpenCustomHashSet, FloatOpenHashBigSet, FloatOpenHashSet, FloatRBTreeSet, FloatSets.EmptySet, FloatSets.Singleton, FloatSets.SynchronizedSet, FloatSets.UnmodifiableSet, FloatSortedSets.EmptySet, FloatSortedSets.Singleton, FloatSortedSets.SynchronizedSortedSet, FloatSortedSets.UnmodifiableSortedSet

public interface FloatCollection
extends java.util.Collection<java.lang.Float>, FloatIterable

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

Method Summary
 boolean add(float key)
           
 boolean addAll(FloatCollection c)
           
 boolean contains(float key)
           
 boolean containsAll(FloatCollection c)
           
 FloatIterator floatIterator()
          Deprecated. As of fastutil 5, replaced by iterator().
 FloatIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(float key)
          Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name.
 boolean removeAll(FloatCollection c)
           
 boolean retainAll(FloatCollection c)
           
 float[] toArray(float[] a)
          Returns a primitive type array containing the items of this collection.
<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.
 float[] toFloatArray()
          Returns a primitive type array containing the items of this collection.
 float[] toFloatArray(float[] a)
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray
 

Method Detail

iterator

FloatIterator 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 java.util.Collection<java.lang.Float>
Specified by:
iterator in interface FloatIterable
Specified by:
iterator in interface java.lang.Iterable<java.lang.Float>
Returns:
a type-specific iterator on the elements of this collection.

floatIterator

@Deprecated
FloatIterator floatIterator()
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 java.util.Collection<java.lang.Float>
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[])

contains

boolean contains(float key)
See Also:
Collection.contains(Object)

toFloatArray

float[] toFloatArray()
Returns a primitive type array containing the items of this collection.

Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

toFloatArray

float[] toFloatArray(float[] a)
Returns a primitive type array containing the items of this collection.

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.

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[])

toArray

float[] toArray(float[] a)
Returns a primitive type array containing the items of this collection.

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.

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[])

add

boolean add(float key)
See Also:
Collection.add(Object)

rem

boolean rem(float key)
Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

See Also:
Collection.remove(Object)

addAll

boolean addAll(FloatCollection c)
See Also:
Collection.addAll(Collection)

containsAll

boolean containsAll(FloatCollection c)
See Also:
Collection.containsAll(Collection)

removeAll

boolean removeAll(FloatCollection c)
See Also:
Collection.removeAll(Collection)

retainAll

boolean retainAll(FloatCollection c)
See Also:
Collection.retainAll(Collection)