it.unimi.dsi.fastutil.floats
Class FloatLists.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.floats.AbstractFloatCollection
      extended byit.unimi.dsi.fastutil.floats.AbstractFloatList
          extended byit.unimi.dsi.fastutil.floats.FloatLists.Singleton
All Implemented Interfaces:
Cloneable, Collection, Comparable, FloatCollection, FloatList, FloatStack, List, Serializable, Stack
Enclosing class:
FloatLists

public static class FloatLists.Singleton
extends AbstractFloatList
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(float k)
           
 void add(int i, float k)
           
 boolean addAll(Collection c)
          Delegates to a more generic method.
 boolean addAll(FloatCollection c)
          Delegates to a more generic method.
 boolean addAll(FloatList c)
          Delegates to a more generic method.
 boolean addAll(int i, Collection c)
           
 boolean addAll(int i, FloatCollection c)
          Delegates to a more generic method.
 boolean addAll(int i, FloatList c)
          Delegates to a more generic method.
 boolean addAll(int i, List c)
           
 boolean addAll(List c)
           
 void clear()
           
 Object clone()
           
 boolean contains(float k)
           
 FloatListIterator floatListIterator()
          Delegates to the corresponding list-iterator method.
 FloatListIterator floatListIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 FloatList floatSubList(int from, int to)
           
 float getFloat(int i)
           
 boolean rem(float 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(FloatCollection c)
          Remove from this collection all elements in the given type-specific collection.
 float removeFloat(int i)
           
 boolean retainAll(Collection c)
          Retains in this collection only elements from the given collection.
 boolean retainAll(FloatCollection 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.
 float[] toFloatArray()
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatList
add, addElements, addElements, compareTo, equals, floatIterator, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekFloat, pop, popFloat, push, push, remove, removeElements, set, set, subList, top, topFloat, toString
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, toArray, toArray, toArray, toFloatArray
 
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.floats.FloatCollection
containsAll, toArray, toFloatArray
 
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(float k)
Description copied from interface: FloatCollection
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 FloatCollection
Overrides:
rem in class AbstractFloatList

add

public boolean add(float k)
Specified by:
add in interface FloatCollection
Overrides:
add in class AbstractFloatCollection

add

public void add(int i,
                float k)
Specified by:
add in interface FloatList
Overrides:
add in class AbstractFloatList

getFloat

public float getFloat(int i)
Specified by:
getFloat in interface FloatList
See Also:
List.get(int)

removeFloat

public float removeFloat(int i)
Specified by:
removeFloat in interface FloatList
Overrides:
removeFloat in class AbstractFloatList

contains

public boolean contains(float k)
Specified by:
contains in interface FloatCollection
Overrides:
contains in class AbstractFloatList

addAll

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

Specified by:
addAll in interface FloatList
Overrides:
addAll in class AbstractFloatList

addAll

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

Specified by:
addAll in interface FloatCollection
Overrides:
addAll in class AbstractFloatList

addAll

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

Specified by:
addAll in interface FloatList
Overrides:
addAll in class AbstractFloatList

addAll

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

Specified by:
addAll in interface FloatList
Overrides:
addAll in class AbstractFloatList

removeAll

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

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

retainAll

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

Specified by:
retainAll in interface FloatCollection
Overrides:
retainAll in class AbstractFloatCollection
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: AbstractFloatList
Delegates to a more generic method.

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

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 AbstractFloatList

removeAll

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

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

toFloatArray

public float[] toFloatArray()
Description copied from interface: FloatCollection
Returns a primitive type array containing the items of this collection.

Specified by:
toFloatArray in interface FloatCollection
Overrides:
toFloatArray in class AbstractFloatCollection

floatListIterator

public FloatListIterator floatListIterator()
Description copied from class: AbstractFloatList
Delegates to the corresponding list-iterator method.

Specified by:
floatListIterator in interface FloatList
Overrides:
floatListIterator in class AbstractFloatList

floatListIterator

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

floatSubList

public FloatList floatSubList(int from,
                              int to)
Specified by:
floatSubList in interface FloatList
Overrides:
floatSubList in class AbstractFloatList

size

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

size

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

clear

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

clone

public Object clone()