it.unimi.dsi.fastutil.booleans
Interface BooleanCollection

All Superinterfaces:
BooleanIterable, Collection<Boolean>, Iterable<Boolean>
All Known Subinterfaces:
BooleanBigList, BooleanList, BooleanSet
All Known Implementing Classes:
AbstractBooleanBigList, AbstractBooleanBigList.BooleanSubList, AbstractBooleanCollection, AbstractBooleanList, AbstractBooleanList.BooleanSubList, AbstractBooleanSet, BooleanArrayList, BooleanArraySet, BooleanBigArrayBigList, BooleanBigLists.EmptyBigList, BooleanBigLists.ListBigList, BooleanBigLists.Singleton, BooleanBigLists.SynchronizedBigList, BooleanBigLists.UnmodifiableBigList, BooleanCollections.EmptyCollection, BooleanCollections.IterableCollection, BooleanCollections.SynchronizedCollection, BooleanCollections.UnmodifiableCollection, BooleanLists.EmptyList, BooleanLists.Singleton, BooleanLists.SynchronizedList, BooleanLists.UnmodifiableList, BooleanOpenHashSet, BooleanSets.EmptySet, BooleanSets.Singleton, BooleanSets.SynchronizedSet, BooleanSets.UnmodifiableSet

public interface BooleanCollection
extends Collection<Boolean>, BooleanIterable

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

BooleanIterator 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 BooleanIterable
Specified by:
iterator in interface Collection<Boolean>
Specified by:
iterator in interface Iterable<Boolean>
Returns:
a type-specific iterator on the elements of this collection.

booleanIterator

@Deprecated
BooleanIterator booleanIterator()
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<Boolean>
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(boolean key)
See Also:
Collection.contains(Object)

toBooleanArray

boolean[] toBooleanArray()
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()

toBooleanArray

boolean[] toBooleanArray(boolean[] 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

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

rem

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

containsAll

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

removeAll

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

retainAll

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