it.unimi.dsi.fastutil.doubles
Interface DoubleCollection

All Superinterfaces:
Collection<Double>, DoubleIterable, Iterable<Double>
All Known Subinterfaces:
DoubleBigList, DoubleList, DoubleSet, DoubleSortedSet
All Known Implementing Classes:
AbstractByte2DoubleSortedMap.ValuesCollection, AbstractChar2DoubleSortedMap.ValuesCollection, AbstractDouble2BooleanSortedMap.KeySet, AbstractDouble2ByteSortedMap.KeySet, AbstractDouble2CharSortedMap.KeySet, AbstractDouble2DoubleSortedMap.KeySet, AbstractDouble2DoubleSortedMap.ValuesCollection, AbstractDouble2FloatSortedMap.KeySet, AbstractDouble2IntSortedMap.KeySet, AbstractDouble2LongSortedMap.KeySet, AbstractDouble2ObjectSortedMap.KeySet, AbstractDouble2ReferenceSortedMap.KeySet, AbstractDouble2ShortSortedMap.KeySet, AbstractDoubleBigList, AbstractDoubleBigList.DoubleSubList, AbstractDoubleCollection, AbstractDoubleList, AbstractDoubleList.DoubleSubList, AbstractDoubleSet, AbstractDoubleSortedSet, AbstractFloat2DoubleSortedMap.ValuesCollection, AbstractInt2DoubleSortedMap.ValuesCollection, AbstractLong2DoubleSortedMap.ValuesCollection, AbstractObject2DoubleSortedMap.ValuesCollection, AbstractReference2DoubleSortedMap.ValuesCollection, AbstractShort2DoubleSortedMap.ValuesCollection, DoubleArrayList, DoubleArraySet, DoubleAVLTreeSet, DoubleBigArrayBigList, DoubleBigLists.EmptyBigList, DoubleBigLists.ListBigList, DoubleBigLists.Singleton, DoubleBigLists.SynchronizedBigList, DoubleBigLists.UnmodifiableBigList, DoubleCollections.EmptyCollection, DoubleCollections.IterableCollection, DoubleCollections.SynchronizedCollection, DoubleCollections.UnmodifiableCollection, DoubleLinkedOpenCustomHashSet, DoubleLinkedOpenHashSet, DoubleLists.EmptyList, DoubleLists.Singleton, DoubleLists.SynchronizedList, DoubleLists.UnmodifiableList, DoubleOpenCustomHashSet, DoubleOpenHashBigSet, DoubleOpenHashSet, DoubleRBTreeSet, DoubleSets.EmptySet, DoubleSets.Singleton, DoubleSets.SynchronizedSet, DoubleSets.UnmodifiableSet, DoubleSortedSets.EmptySet, DoubleSortedSets.Singleton, DoubleSortedSets.SynchronizedSortedSet, DoubleSortedSets.UnmodifiableSortedSet

public interface DoubleCollection
extends Collection<Double>, DoubleIterable

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(double key)
           
 boolean addAll(DoubleCollection c)
           
 boolean contains(double key)
           
 boolean containsAll(DoubleCollection c)
           
 DoubleIterator doubleIterator()
          Deprecated. As of fastutil 5, replaced by iterator().
 DoubleIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(double 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(DoubleCollection c)
           
 boolean retainAll(DoubleCollection c)
           
 double[] toArray(double[] 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.
 double[] toDoubleArray()
          Returns a primitive type array containing the items of this collection.
 double[] toDoubleArray(double[] 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

DoubleIterator 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<Double>
Specified by:
iterator in interface DoubleIterable
Specified by:
iterator in interface Iterable<Double>
Returns:
a type-specific iterator on the elements of this collection.

doubleIterator

@Deprecated
DoubleIterator doubleIterator()
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<Double>
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(double key)
See Also:
Collection.contains(Object)

toDoubleArray

double[] toDoubleArray()
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()

toDoubleArray

double[] toDoubleArray(double[] 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

double[] toArray(double[] 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(double key)
See Also:
Collection.add(Object)

rem

boolean rem(double 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(DoubleCollection c)
See Also:
Collection.addAll(Collection)

containsAll

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

removeAll

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

retainAll

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


Copyright © 2011. All Rights Reserved.