it.unimi.dsi.fastutil.floats
Class AbstractFloatList.FloatSubList

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

public static class AbstractFloatList.FloatSubList
extends AbstractFloatList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatList
AbstractFloatList.FloatSubList
 
Constructor Summary
AbstractFloatList.FloatSubList(FloatList l, int from, int to)
           
 
Method Summary
 boolean add(float k)
           
 void add(int index, float k)
           
 boolean addAll(int index, Collection c)
           
 boolean addAll(int index, FloatCollection c)
          Delegates to a more generic method.
 boolean addAll(int index, FloatList l)
          Delegates to a more generic method.
 void addElements(int index, float[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 void clear()
           
 FloatListIterator floatListIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 FloatList floatSubList(int from, int to)
           
 void getElements(int from, float[] a, int offset, int length)
          Copies element of this type-specific list into the given array one-by-one.
 float getFloat(int index)
           
 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.
 void removeElements(int from, int to)
          Removes elements of this type-specific list one-by-one.
 float removeFloat(int index)
           
 float set(int index, float k)
           
 int size()
           
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatList
add, addAll, addAll, addAll, addElements, compareTo, contains, equals, floatIterator, floatListIterator, get, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekFloat, pop, popFloat, push, push, remove, set, size, subList, top, topFloat, toString
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toFloatArray, 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, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
containsAll, removeAll, retainAll, toArray, toFloatArray, toFloatArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Constructor Detail

AbstractFloatList.FloatSubList

public AbstractFloatList.FloatSubList(FloatList l,
                                      int from,
                                      int to)
Method Detail

add

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

add

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

addAll

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

addAll

public boolean addAll(int index,
                      FloatCollection 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 index,
                      FloatList l)
Description copied from class: AbstractFloatList
Delegates to a more generic method.

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

getFloat

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

removeFloat

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

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

set

public float set(int index,
                 float k)
Specified by:
set in interface FloatList
Overrides:
set in class AbstractFloatList

clear

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

size

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

getElements

public void getElements(int from,
                        float[] a,
                        int offset,
                        int length)
Description copied from class: AbstractFloatList
Copies element of this type-specific list into the given array one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
getElements in interface FloatList
Overrides:
getElements in class AbstractFloatList
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 class: AbstractFloatList
Removes elements of this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
removeElements in interface FloatList
Overrides:
removeElements in class AbstractFloatList
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 class: AbstractFloatList
Adds elements to this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
addElements in interface FloatList
Overrides:
addElements in class AbstractFloatList
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.

floatListIterator

public FloatListIterator floatListIterator(int index)
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
Overrides:
floatListIterator in class AbstractFloatList

floatSubList

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