it.unimi.dsi.fastutil.booleans
Class BooleanCollections.SynchronizedCollection

java.lang.Object
  extended byit.unimi.dsi.fastutil.booleans.BooleanCollections.SynchronizedCollection
All Implemented Interfaces:
BooleanCollection, Collection, Serializable
Direct Known Subclasses:
BooleanLists.SynchronizedList, BooleanSets.SynchronizedSet
Enclosing class:
BooleanCollections

public static class BooleanCollections.SynchronizedCollection
extends Object
implements BooleanCollection, Serializable

A synchronized wrapper class for collections.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(boolean k)
           
 boolean add(Object k)
           
 boolean addAll(BooleanCollection c)
           
 boolean addAll(Collection c)
           
 BooleanIterator booleanIterator()
          Returns a type-specific iterator on the collection.
 void clear()
           
 boolean contains(boolean o)
           
 boolean contains(Object k)
           
 boolean containsAll(BooleanCollection c)
           
 boolean containsAll(Collection c)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean rem(boolean 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(BooleanCollection c)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(BooleanCollection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 boolean[] toArray(boolean[] a)
          Builds a primitive type array containing the items of this collection.
 Object[] toArray(Object[] a)
           
 boolean[] toBooleanArray()
          Returns a primitive type array containing the items of this collection.
 boolean[] toBooleanArray(boolean[] a)
          Builds 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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

contains

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

toBooleanArray

public boolean[] toBooleanArray()
Description copied from interface: BooleanCollection
Returns a primitive type array containing the items of this collection.

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

toBooleanArray

public boolean[] toBooleanArray(boolean[] a)
Description copied from interface: BooleanCollection
Builds a primitive type array containing the items of this collection.

Specified by:
toBooleanArray in interface BooleanCollection
Parameters:
a - if this array is big enough, it will be used to store the collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

iterator

public Iterator iterator()
Specified by:
iterator in interface Collection

booleanIterator

public BooleanIterator booleanIterator()
Description copied from interface: BooleanCollection
Returns a type-specific iterator on the collection.

The iterator returned by the Collection.iterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
booleanIterator in interface BooleanCollection
See Also:
Collection.iterator()

add

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

rem

public boolean rem(boolean k)
Description copied from interface: BooleanCollection
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 BooleanCollection
See Also:
Collection.remove(Object)

remove

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

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection

addAll

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

containsAll

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

removeAll

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

retainAll

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

clear

public void clear()
Specified by:
clear in interface Collection

toString

public String toString()

add

public boolean add(Object k)
Specified by:
add in interface Collection

contains

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

toArray

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

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection

toArray

public boolean[] toArray(boolean[] a)
Description copied from interface: BooleanCollection
Builds a primitive type array containing the items of this collection.

Specified by:
toArray in interface BooleanCollection
Parameters:
a - if this array is big enough, it will be used to store the collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])