it.unimi.dsi.fastutil.floats
Class FloatCollections.SynchronizedCollection

java.lang.Object
  extended by it.unimi.dsi.fastutil.floats.FloatCollections.SynchronizedCollection
All Implemented Interfaces:
FloatCollection, FloatIterable, Serializable, Iterable<Float>, Collection<Float>
Direct Known Subclasses:
FloatBigLists.SynchronizedBigList, FloatLists.SynchronizedList, FloatSets.SynchronizedSet
Enclosing class:
FloatCollections

public static class FloatCollections.SynchronizedCollection
extends Object
implements FloatCollection, Serializable

A synchronized wrapper class for collections.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(float k)
           
 boolean add(Float k)
           
 boolean addAll(Collection<? extends Float> c)
           
 boolean addAll(FloatCollection c)
           
 void clear()
           
 boolean contains(float o)
           
 boolean contains(Object k)
           
 boolean containsAll(Collection<?> c)
           
 boolean containsAll(FloatCollection c)
           
 FloatIterator floatIterator()
          Deprecated. 
 boolean isEmpty()
           
 FloatIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 boolean rem(float k)
          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 remove(Object ok)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeAll(FloatCollection c)
           
 boolean retainAll(Collection<?> c)
           
 boolean retainAll(FloatCollection c)
           
 int size()
           
 Object[] toArray()
           
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

size

public int size()
Specified by:
size in interface Collection<Float>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Float>

contains

public boolean contains(float o)
Specified by:
contains in interface FloatCollection
See Also:
Collection.contains(Object)

toFloatArray

public float[] toFloatArray()
Description copied from interface: FloatCollection
Returns a primitive type array containing the items of this collection.

Specified by:
toFloatArray in interface FloatCollection
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Float>

toFloatArray

public float[] toFloatArray(float[] a)
Description copied from interface: FloatCollection
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.

Specified by:
toFloatArray in interface FloatCollection
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

public float[] toArray(float[] a)
Description copied from interface: FloatCollection
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.

Specified by:
toArray in interface FloatCollection
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[])

addAll

public boolean addAll(FloatCollection c)
Specified by:
addAll in interface FloatCollection
See Also:
Collection.addAll(Collection)

containsAll

public boolean containsAll(FloatCollection c)
Specified by:
containsAll in interface FloatCollection
See Also:
Collection.containsAll(Collection)

removeAll

public boolean removeAll(FloatCollection c)
Specified by:
removeAll in interface FloatCollection
See Also:
Collection.removeAll(Collection)

retainAll

public boolean retainAll(FloatCollection c)
Specified by:
retainAll in interface FloatCollection
See Also:
Collection.retainAll(Collection)

add

public boolean add(Float k)
Specified by:
add in interface Collection<Float>

contains

public boolean contains(Object k)
Specified by:
contains in interface Collection<Float>

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: FloatCollection
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 FloatCollection
Specified by:
toArray in interface Collection<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[])

iterator

public FloatIterator iterator()
Description copied from interface: FloatCollection
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 FloatCollection
Specified by:
iterator in interface FloatIterable
Specified by:
iterator in interface Iterable<Float>
Specified by:
iterator in interface Collection<Float>
Returns:
a type-specific iterator on the elements of this collection.

floatIterator

@Deprecated
public FloatIterator floatIterator()
Deprecated. 

Description copied from interface: FloatCollection
Returns a type-specific iterator on this elements of this collection.

Specified by:
floatIterator in interface FloatCollection
See Also:
FloatCollection.iterator()

add

public boolean add(float k)
Specified by:
add in interface FloatCollection
See Also:
Collection.add(Object)

rem

public boolean rem(float k)
Description copied from interface: FloatCollection
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().

Specified by:
rem in interface FloatCollection
See Also:
Collection.remove(Object)

remove

public boolean remove(Object ok)
Specified by:
remove in interface Collection<Float>

addAll

public boolean addAll(Collection<? extends Float> c)
Specified by:
addAll in interface Collection<Float>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Float>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Float>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Float>

clear

public void clear()
Specified by:
clear in interface Collection<Float>

toString

public String toString()
Overrides:
toString in class Object