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

java.lang.Object
  extended by it.unimi.dsi.fastutil.floats.AbstractFloatCollection
      extended by it.unimi.dsi.fastutil.floats.FloatCollections.EmptyCollection
          extended by it.unimi.dsi.fastutil.floats.FloatLists.EmptyList
All Implemented Interfaces:
FloatCollection, FloatIterable, FloatList, Serializable, Cloneable, Comparable<List<? extends Float>>, Iterable<Float>, Collection<Float>, List<Float>
Enclosing class:
FloatLists

public static class FloatLists.EmptyList
extends FloatCollections.EmptyCollection
implements FloatList, Serializable, Cloneable

An immutable class representing an empty type-specific 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)
           
 boolean add(Float k)
          Delegates to the corresponding type-specific method.
 void add(int index, float k)
           
 void add(int index, Float k)
           
 boolean addAll(Collection<? extends Float> c)
          Adds all elements of the given collection to this collection.
 boolean addAll(FloatCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(FloatList c)
           
 boolean addAll(int i, Collection<? extends Float> c)
           
 boolean addAll(int i, FloatCollection c)
           
 boolean addAll(int i, FloatList c)
           
 void addElements(int index, float[] a)
          Add (hopefully quickly) elements to this type-specific list.
 void addElements(int index, float[] a, int offset, int length)
          Add (hopefully quickly) elements to this type-specific list.
 Object clone()
           
 int compareTo(List<? extends Float> o)
           
 FloatIterator floatIterator()
          Deprecated. 
 FloatListIterator floatListIterator()
          Deprecated. 
 FloatListIterator floatListIterator(int i)
          Deprecated. 
 FloatList floatSubList(int from, int to)
          Deprecated. 
 Float get(int i)
           
 void getElements(int from, float[] a, int offset, int length)
          Copies (hopefully quickly) elements of this type-specific list into the given array.
 float getFloat(int i)
           
 int indexOf(float k)
           
 int indexOf(Object k)
           
 int lastIndexOf(float k)
           
 int lastIndexOf(Object k)
           
 FloatListIterator listIterator()
          Returns a type-specific list iterator on the list.
 FloatListIterator listIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 Float remove(int k)
           
 boolean removeAll(Collection<?> c)
          Remove from this collection all elements in the given collection.
 void removeElements(int from, int to)
          Removes (hopefully quickly) elements of this type-specific list.
 float removeFloat(int i)
           
 float set(int index, float k)
           
 Float set(int index, Float k)
           
 void size(int s)
          Sets the size of this list.
 FloatList subList(int from, int to)
          Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.
 
Methods inherited from class it.unimi.dsi.fastutil.floats.FloatCollections.EmptyCollection
clear, contains, containsAll, equals, hashCode, iterator, rem, removeAll, retainAll, size, toArray, toFloatArray, toFloatArray
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
contains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatList
iterator
 
Methods inherited from interface java.util.List
clear, contains, containsAll, equals, hashCode, isEmpty, remove, retainAll, size, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toFloatArray, toFloatArray
 

Field Detail

serialVersionUID

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

add

public void add(int index,
                float k)
Specified by:
add in interface FloatList
See Also:
List.add(int,Object)

add

public boolean add(float k)
Specified by:
add in interface FloatCollection
Overrides:
add in class FloatCollections.EmptyCollection
See Also:
Collection.add(Object)

removeFloat

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

set

public float set(int index,
                 float k)
Specified by:
set in interface FloatList
See Also:
List.set(int,Object)

indexOf

public int indexOf(float k)
Specified by:
indexOf in interface FloatList
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(float k)
Specified by:
lastIndexOf in interface FloatList
See Also:
List.lastIndexOf(Object)

addAll

public boolean addAll(Collection<? extends Float> c)
Description copied from class: AbstractFloatCollection
Adds all elements of the given collection to this collection.

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

addAll

public boolean addAll(int i,
                      Collection<? extends Float> c)
Specified by:
addAll in interface List<Float>

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 Collection<Float>
Specified by:
removeAll in interface List<Float>
Overrides:
removeAll in class AbstractFloatCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

get

public Float get(int i)
Specified by:
get in interface List<Float>

addAll

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

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

addAll

public boolean addAll(FloatList c)
Specified by:
addAll in interface FloatList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int i,
                      FloatCollection c)
Specified by:
addAll in interface FloatList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int i,
                      FloatList c)
Specified by:
addAll in interface FloatList
See Also:
List.add(int,Object)

add

public void add(int index,
                Float k)
Specified by:
add in interface List<Float>

add

public boolean add(Float k)
Description copied from class: AbstractFloatCollection
Delegates to the corresponding type-specific method.

Specified by:
add in interface Collection<Float>
Specified by:
add in interface List<Float>
Overrides:
add in class AbstractFloatCollection

set

public Float set(int index,
                 Float k)
Specified by:
set in interface List<Float>

getFloat

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

remove

public Float remove(int k)
Specified by:
remove in interface List<Float>

indexOf

public int indexOf(Object k)
Specified by:
indexOf in interface List<Float>

lastIndexOf

public int lastIndexOf(Object k)
Specified by:
lastIndexOf in interface List<Float>

floatIterator

@Deprecated
public FloatIterator floatIterator()
Deprecated. 

Description copied from class: AbstractFloatCollection
Delegates to the new covariantly stronger generic method.

Specified by:
floatIterator in interface FloatCollection
Overrides:
floatIterator in class AbstractFloatCollection
See Also:
FloatCollection.iterator()

listIterator

public FloatListIterator listIterator()
Description copied from interface: FloatList
Returns a type-specific list iterator on the list.

Specified by:
listIterator in interface FloatList
Specified by:
listIterator in interface List<Float>
See Also:
FloatList.listIterator()

listIterator

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

Specified by:
listIterator in interface FloatList
Specified by:
listIterator in interface List<Float>
See Also:
FloatList.listIterator(int)

floatListIterator

@Deprecated
public FloatListIterator floatListIterator()
Deprecated. 

Description copied from interface: FloatList
Returns a type-specific list iterator on the list.

Specified by:
floatListIterator in interface FloatList
See Also:
FloatList.listIterator()

floatListIterator

@Deprecated
public FloatListIterator floatListIterator(int i)
Deprecated. 

Description copied from interface: FloatList
Returns a type-specific list iterator on the list starting at a given index.

Specified by:
floatListIterator in interface FloatList
See Also:
FloatList.listIterator(int)

subList

public FloatList subList(int from,
                         int to)
Description copied from interface: FloatList
Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.

Note that this specification strengthens the one given in List.subList(int,int).

Specified by:
subList in interface FloatList
Specified by:
subList in interface List<Float>
See Also:
List.subList(int,int)

floatSubList

@Deprecated
public FloatList floatSubList(int from,
                                         int to)
Deprecated. 

Description copied from interface: FloatList
Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.

Specified by:
floatSubList in interface FloatList
See Also:
List.subList(int,int)

getElements

public void getElements(int from,
                        float[] a,
                        int offset,
                        int length)
Description copied from interface: FloatList
Copies (hopefully quickly) elements of this type-specific list into the given array.

Specified by:
getElements in interface FloatList
Parameters:
from - the start index (inclusive).
a - the destination array.
offset - the offset into the destination array where to store the first element copied.
length - the number of elements to be copied.

removeElements

public void removeElements(int from,
                           int to)
Description copied from interface: FloatList
Removes (hopefully quickly) elements of this type-specific list.

Specified by:
removeElements in interface FloatList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(int index,
                        float[] a,
                        int offset,
                        int length)
Description copied from interface: FloatList
Add (hopefully quickly) elements to this type-specific list.

Specified by:
addElements in interface FloatList
Parameters:
index - the index at which to add elements.
a - the array containing the elements.
offset - the offset of the first element to add.
length - the number of elements to add.

addElements

public void addElements(int index,
                        float[] a)
Description copied from interface: FloatList
Add (hopefully quickly) elements to this type-specific list.

Specified by:
addElements in interface FloatList
Parameters:
index - the index at which to add elements.
a - the array containing the elements.

size

public void size(int s)
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
Parameters:
s - the new size.

compareTo

public int compareTo(List<? extends Float> o)
Specified by:
compareTo in interface Comparable<List<? extends Float>>

clone

public Object clone()
Overrides:
clone in class Object