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

java.lang.Object
  extended by it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
      extended by it.unimi.dsi.fastutil.booleans.BooleanCollections.EmptyCollection
All Implemented Interfaces:
BooleanCollection, BooleanIterable, java.lang.Iterable<java.lang.Boolean>, java.util.Collection<java.lang.Boolean>
Direct Known Subclasses:
BooleanLists.EmptyList, BooleanSets.EmptySet
Enclosing class:
BooleanCollections

public abstract static class BooleanCollections.EmptyCollection
extends AbstractBooleanCollection

An immutable class representing an empty type-specific collection.

This class may be useful to implement your own in case you subclass a type-specific collection.


Method Summary
 boolean add(boolean k)
           
 boolean addAll(BooleanCollection c)
          Adds all elements of the given type-specific collection to this collection.
 void clear()
           
 boolean contains(boolean k)
           
 boolean containsAll(BooleanCollection c)
          Checks whether this collection contains all elements from the given type-specific collection.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 BooleanListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 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 removeAll(BooleanCollection c)
          Remove from this collection all elements in the given type-specific collection.
 boolean retainAll(BooleanCollection c)
          Retains in this collection only elements from the given type-specific collection.
 int size()
           
 java.lang.Object[] toArray()
           
 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 class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, addAll, booleanIterator, contains, containsAll, isEmpty, rem, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

add

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

contains

public boolean contains(boolean k)
See Also:
Collection.contains(Object)

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<java.lang.Boolean>
Overrides:
toArray in class AbstractBooleanCollection

toBooleanArray

public boolean[] toBooleanArray(boolean[] a)
Description copied from interface: BooleanCollection
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:
toBooleanArray in interface BooleanCollection
Overrides:
toBooleanArray in class AbstractBooleanCollection
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[])

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
Overrides:
toBooleanArray in class AbstractBooleanCollection
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

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
Overrides:
rem in class AbstractBooleanCollection
See Also:
Collection.remove(Object)

addAll

public boolean addAll(BooleanCollection c)
Description copied from class: AbstractBooleanCollection
Adds all elements of the given type-specific collection to this collection.

Specified by:
addAll in interface BooleanCollection
Overrides:
addAll in class AbstractBooleanCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection changed as a result of the call.
See Also:
Collection.addAll(Collection)

removeAll

public boolean removeAll(BooleanCollection c)
Description copied from class: AbstractBooleanCollection
Remove from this collection all elements in the given type-specific collection.

Specified by:
removeAll in interface BooleanCollection
Overrides:
removeAll in class AbstractBooleanCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection changed as a result of the call.
See Also:
Collection.removeAll(Collection)

retainAll

public boolean retainAll(BooleanCollection c)
Description copied from class: AbstractBooleanCollection
Retains in this collection only elements from the given type-specific collection.

Specified by:
retainAll in interface BooleanCollection
Overrides:
retainAll in class AbstractBooleanCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection changed as a result of the call.
See Also:
Collection.retainAll(Collection)

containsAll

public boolean containsAll(BooleanCollection c)
Description copied from class: AbstractBooleanCollection
Checks whether this collection contains all elements from the given type-specific collection.

Specified by:
containsAll in interface BooleanCollection
Overrides:
containsAll in class AbstractBooleanCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection contains all elements of the argument.
See Also:
Collection.containsAll(Collection)

iterator

public BooleanListIterator iterator()
Description copied from interface: BooleanCollection
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 BooleanCollection
Specified by:
iterator in interface BooleanIterable
Specified by:
iterator in interface java.lang.Iterable<java.lang.Boolean>
Specified by:
iterator in interface java.util.Collection<java.lang.Boolean>
Specified by:
iterator in class AbstractBooleanCollection
Returns:
a type-specific iterator on the elements of this collection.

size

public int size()

clear

public void clear()
Specified by:
clear in interface java.util.Collection<java.lang.Boolean>
Overrides:
clear in class AbstractBooleanCollection

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<java.lang.Boolean>
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection<java.lang.Boolean>
Overrides:
equals in class java.lang.Object