it.unimi.dsi.fastutil.booleans
Class BooleanLists.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
      extended byit.unimi.dsi.fastutil.booleans.AbstractBooleanList
          extended byit.unimi.dsi.fastutil.booleans.BooleanLists.Singleton
All Implemented Interfaces:
BooleanCollection, BooleanList, BooleanStack, Cloneable, Collection, List, Serializable, Stack
Enclosing class:
BooleanLists

public static class BooleanLists.Singleton
extends AbstractBooleanList
implements Serializable, Cloneable

An immutable class representing a type-specific singleton list.

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

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(boolean k)
           
 void add(int i, boolean k)
           
 boolean addAll(BooleanCollection c)
          Delegates to a more generic method.
 boolean addAll(BooleanList c)
          Delegates to a more generic method.
 boolean addAll(Collection c)
          Delegates to a more generic method.
 boolean addAll(int i, BooleanCollection c)
          Delegates to a more generic method.
 boolean addAll(int i, BooleanList c)
          Delegates to a more generic method.
 boolean addAll(int i, Collection c)
           
 boolean addAll(int i, List c)
           
 boolean addAll(List c)
           
 BooleanListIterator booleanListIterator()
          Delegates to the corresponding list-iterator method.
 BooleanListIterator booleanListIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 BooleanList booleanSubList(int from, int to)
           
 void clear()
           
 Object clone()
           
 boolean contains(boolean k)
           
 boolean getBoolean(int i)
           
 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 removeAll(Collection c)
          Remove from this collection all elements in the given collection.
 boolean removeBoolean(int i)
           
 boolean retainAll(BooleanCollection c)
          Retains in this collection only elements from the given type-specific collection.
 boolean retainAll(Collection c)
          Retains in this collection only elements from the given collection.
 int size()
           
 void size(int size)
          Sets the size of this list.
 boolean[] toBooleanArray()
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanList
add, addElements, addElements, booleanIterator, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekBoolean, pop, popBoolean, push, push, remove, removeElements, set, set, subList, top, topBoolean, toString
 
Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, toArray, toArray, toArray, toBooleanArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, contains, containsAll, isEmpty, iterator, remove, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection
containsAll, toArray, toBooleanArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

serialVersionUID

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

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 AbstractBooleanList

add

public boolean add(boolean k)
Specified by:
add in interface BooleanCollection
Overrides:
add in class AbstractBooleanCollection

add

public void add(int i,
                boolean k)
Specified by:
add in interface BooleanList
Overrides:
add in class AbstractBooleanList

getBoolean

public boolean getBoolean(int i)
Specified by:
getBoolean in interface BooleanList
See Also:
List.get(int)

removeBoolean

public boolean removeBoolean(int i)
Specified by:
removeBoolean in interface BooleanList
Overrides:
removeBoolean in class AbstractBooleanList

contains

public boolean contains(boolean k)
Specified by:
contains in interface BooleanCollection
Overrides:
contains in class AbstractBooleanList

addAll

public boolean addAll(BooleanList c)
Description copied from class: AbstractBooleanList
Delegates to a more generic method.

Specified by:
addAll in interface BooleanList
Overrides:
addAll in class AbstractBooleanList

addAll

public boolean addAll(BooleanCollection c)
Description copied from class: AbstractBooleanList
Delegates to a more generic method.

Specified by:
addAll in interface BooleanCollection
Overrides:
addAll in class AbstractBooleanList

addAll

public boolean addAll(int i,
                      BooleanList c)
Description copied from class: AbstractBooleanList
Delegates to a more generic method.

Specified by:
addAll in interface BooleanList
Overrides:
addAll in class AbstractBooleanList

addAll

public boolean addAll(int i,
                      BooleanCollection c)
Description copied from class: AbstractBooleanList
Delegates to a more generic method.

Specified by:
addAll in interface BooleanList
Overrides:
addAll in class AbstractBooleanList

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.

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.

addAll

public boolean addAll(List c)

addAll

public boolean addAll(Collection c)
Description copied from class: AbstractBooleanList
Delegates to a more generic method.

Specified by:
addAll in interface List
Overrides:
addAll in class AbstractBooleanList

addAll

public boolean addAll(int i,
                      List c)

addAll

public boolean addAll(int i,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractBooleanList

removeAll

public boolean removeAll(Collection c)
Description copied from class: AbstractBooleanCollection
Remove from this collection all elements in the given collection. If the collection is an instance of this class, it uses faster iterators.

Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractBooleanCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

retainAll

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

Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractBooleanCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

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

booleanListIterator

public BooleanListIterator booleanListIterator()
Description copied from class: AbstractBooleanList
Delegates to the corresponding list-iterator method.

Specified by:
booleanListIterator in interface BooleanList
Overrides:
booleanListIterator in class AbstractBooleanList

booleanListIterator

public BooleanListIterator booleanListIterator(int i)
Description copied from interface: BooleanList
Returns a type-specific list iterator on the list starting at a given index.

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

Specified by:
booleanListIterator in interface BooleanList
See Also:
List.listIterator(int)

booleanSubList

public BooleanList booleanSubList(int from,
                                  int to)
Specified by:
booleanSubList in interface BooleanList
Overrides:
booleanSubList in class AbstractBooleanList

size

public int size()
Specified by:
size in interface List

size

public void size(int size)
Description copied from interface: BooleanList
Sets the size of this list.

If the specified size is smaller than the current size, the last elements are discarded. Otherwise, they are filled with 0/null/false.

Specified by:
size in interface BooleanList
Overrides:
size in class AbstractBooleanList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractBooleanCollection

clone

public Object clone()