it.unimi.dsi.fastutil.doubles
Class DoubleLists.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
      extended byit.unimi.dsi.fastutil.doubles.AbstractDoubleList
          extended byit.unimi.dsi.fastutil.doubles.DoubleLists.Singleton
All Implemented Interfaces:
Cloneable, Collection, Comparable, DoubleCollection, DoubleList, DoubleStack, List, Serializable, Stack
Enclosing class:
DoubleLists

public static class DoubleLists.Singleton
extends AbstractDoubleList
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(double k)
           
 void add(int i, double k)
           
 boolean addAll(Collection c)
          Delegates to a more generic method.
 boolean addAll(DoubleCollection c)
          Delegates to a more generic method.
 boolean addAll(DoubleList c)
          Delegates to a more generic method.
 boolean addAll(int i, Collection c)
           
 boolean addAll(int i, DoubleCollection c)
          Delegates to a more generic method.
 boolean addAll(int i, DoubleList c)
          Delegates to a more generic method.
 boolean addAll(int i, List c)
           
 boolean addAll(List c)
           
 void clear()
           
 Object clone()
           
 boolean contains(double k)
           
 DoubleListIterator doubleListIterator()
          Delegates to the corresponding list-iterator method.
 DoubleListIterator doubleListIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 DoubleList doubleSubList(int from, int to)
           
 double getDouble(int i)
           
 boolean rem(double 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(Collection c)
          Remove from this collection all elements in the given collection.
 boolean removeAll(DoubleCollection c)
          Remove from this collection all elements in the given type-specific collection.
 double removeDouble(int i)
           
 boolean retainAll(Collection c)
          Retains in this collection only elements from the given collection.
 boolean retainAll(DoubleCollection c)
          Retains in this collection only elements from the given type-specific collection.
 int size()
           
 void size(int size)
          Sets the size of this list.
 double[] toDoubleArray()
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleList
add, addElements, addElements, compareTo, doubleIterator, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekDouble, pop, popDouble, push, push, remove, removeElements, set, set, subList, top, topDouble, toString
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, toArray, toArray, toArray, toDoubleArray
 
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.doubles.DoubleCollection
containsAll, toArray, toDoubleArray
 
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(double k)
Description copied from interface: DoubleCollection
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 DoubleCollection
Overrides:
rem in class AbstractDoubleList

add

public boolean add(double k)
Specified by:
add in interface DoubleCollection
Overrides:
add in class AbstractDoubleCollection

add

public void add(int i,
                double k)
Specified by:
add in interface DoubleList
Overrides:
add in class AbstractDoubleList

getDouble

public double getDouble(int i)
Specified by:
getDouble in interface DoubleList
See Also:
List.get(int)

removeDouble

public double removeDouble(int i)
Specified by:
removeDouble in interface DoubleList
Overrides:
removeDouble in class AbstractDoubleList

contains

public boolean contains(double k)
Specified by:
contains in interface DoubleCollection
Overrides:
contains in class AbstractDoubleList

addAll

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

Specified by:
addAll in interface DoubleList
Overrides:
addAll in class AbstractDoubleList

addAll

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

Specified by:
addAll in interface DoubleCollection
Overrides:
addAll in class AbstractDoubleList

addAll

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

Specified by:
addAll in interface DoubleList
Overrides:
addAll in class AbstractDoubleList

addAll

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

Specified by:
addAll in interface DoubleList
Overrides:
addAll in class AbstractDoubleList

removeAll

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

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

retainAll

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

Specified by:
retainAll in interface DoubleCollection
Overrides:
retainAll in class AbstractDoubleCollection
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: AbstractDoubleList
Delegates to a more generic method.

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

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 AbstractDoubleList

removeAll

public boolean removeAll(Collection c)
Description copied from class: AbstractDoubleCollection
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 AbstractDoubleCollection
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: AbstractDoubleCollection
Retains in this collection only elements from the given collection.

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

toDoubleArray

public double[] toDoubleArray()
Description copied from interface: DoubleCollection
Returns a primitive type array containing the items of this collection.

Specified by:
toDoubleArray in interface DoubleCollection
Overrides:
toDoubleArray in class AbstractDoubleCollection

doubleListIterator

public DoubleListIterator doubleListIterator()
Description copied from class: AbstractDoubleList
Delegates to the corresponding list-iterator method.

Specified by:
doubleListIterator in interface DoubleList
Overrides:
doubleListIterator in class AbstractDoubleList

doubleListIterator

public DoubleListIterator doubleListIterator(int i)
Description copied from interface: DoubleList
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:
doubleListIterator in interface DoubleList
See Also:
List.listIterator(int)

doubleSubList

public DoubleList doubleSubList(int from,
                                int to)
Specified by:
doubleSubList in interface DoubleList
Overrides:
doubleSubList in class AbstractDoubleList

size

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

size

public void size(int size)
Description copied from interface: DoubleList
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 DoubleList
Overrides:
size in class AbstractDoubleList

clear

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

clone

public Object clone()