it.unimi.dsi.fastutil.floats
Class FloatBigLists.ListBigList

java.lang.Object
  extended by java.util.AbstractCollection<Float>
      extended by it.unimi.dsi.fastutil.floats.AbstractFloatCollection
          extended by it.unimi.dsi.fastutil.floats.AbstractFloatBigList
              extended by it.unimi.dsi.fastutil.floats.FloatBigLists.ListBigList
All Implemented Interfaces:
BigList<Float>, FloatBigList, FloatCollection, FloatIterable, FloatStack, Size64, Stack<Float>, Serializable, Comparable<BigList<? extends Float>>, Iterable<Float>, Collection<Float>
Enclosing class:
FloatBigLists

public static class FloatBigLists.ListBigList
extends AbstractFloatBigList
implements Serializable

A class exposing a list as a big list.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatBigList
AbstractFloatBigList.FloatSubList
 
Field Summary
static long serialVersionUID
           
 
Constructor Summary
protected FloatBigLists.ListBigList(FloatList list)
           
 
Method Summary
 boolean add(float key)
           
 void add(long index, float key)
           
 boolean addAll(Collection<? extends Float> c)
          Delegates to a more generic method.
 boolean addAll(FloatBigList c)
           
 boolean addAll(FloatCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(long index, Collection<? extends Float> c)
          Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
 boolean addAll(long index, FloatBigList c)
          Delegates to a more generic method.
 boolean addAll(long index, FloatCollection c)
          Delegates to a more generic method.
 void clear()
           
 boolean contains(float key)
           
 boolean containsAll(Collection<?> c)
          Checks whether this collection contains all elements from the given collection.
 boolean containsAll(FloatCollection c)
          Checks whether this collection contains all elements from the given type-specific collection.
 float getFloat(long index)
           
 int hashCode()
          Returns the hash code for this big list, which is identical to List.hashCode().
 long indexOf(float k)
           
 boolean isEmpty()
          Checks whether the stack is empty.
 FloatBigListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 long lastIndexOf(float k)
           
 FloatBigListIterator listIterator()
          Returns a type-specific big-list iterator on this type-specific big list.
 FloatBigListIterator listIterator(long index)
          Returns a type-specific list iterator on this type-specific big list starting at a given index.
 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.
 void removeElements(long from, long to)
          Removes elements of this type-specific big list one-by-one.
 float removeFloat(long index)
           
 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.
 float set(long index, float k)
           
 int size()
          Deprecated. 
 void size(long size)
          Sets the size of this big list.
 long size64()
          Returns the size of this data structure as a long.
 FloatBigList subList(long from, long to)
          Returns a type-specific view of the portion of this type-specific big list from the index from, inclusive, to the index to, exclusive.
<T> T[]
toArray(T[] a)
          Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.
 float[] toFloatArray()
          Returns a primitive type array containing the items of this collection.
 float[] toFloatArray(float[] a)
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatBigList
add, addAll, addElements, addElements, compareTo, ensureIndex, ensureRestrictedIndex, equals, get, getElements, getFloat, indexOf, lastIndexOf, listIterator, peek, peekFloat, pop, popFloat, push, push, rem, remove, remove, removeFloat, set, set, size, top, topFloat, toString
 
Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
add, contains, floatIterator, rem, remove, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
floatIterator, toArray
 
Methods inherited from interface java.util.Collection
add, contains, remove, toArray
 

Field Detail

serialVersionUID

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

FloatBigLists.ListBigList

protected FloatBigLists.ListBigList(FloatList list)
Method Detail

size64

public long size64()
Description copied from interface: Size64
Returns the size of this data structure as a long.

Specified by:
size64 in interface Size64
Returns:
the size of this data structure.

size

@Deprecated
public int size()
Deprecated. 

Description copied from interface: Size64
Returns the size of this data structure, minimized with Integer.MAX_VALUE.

Specified by:
size in interface Size64
Specified by:
size in interface Collection<Float>
Overrides:
size in class AbstractFloatBigList
Returns:
the size of this data structure, minimized with Integer.MAX_VALUE.
See Also:
Collection.size()

size

public void size(long size)
Description copied from interface: BigList
Sets the size of this big 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 BigList<Float>
Overrides:
size in class AbstractFloatBigList
Parameters:
size - the new size.

iterator

public FloatBigListIterator iterator()
Description copied from interface: FloatCollection
Returns a type-specific iterator on the elements of this collection.

Note that this specification strengthens the one given in Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends Collection.

Specified by:
iterator in interface FloatBigList
Specified by:
iterator in interface FloatCollection
Specified by:
iterator in interface FloatIterable
Specified by:
iterator in interface Iterable<Float>
Specified by:
iterator in interface Collection<Float>
Overrides:
iterator in class AbstractFloatBigList
Returns:
a type-specific iterator on the elements of this collection.
See Also:
List.iterator()

listIterator

public FloatBigListIterator listIterator()
Description copied from interface: FloatBigList
Returns a type-specific big-list iterator on this type-specific big list.

Specified by:
listIterator in interface BigList<Float>
Specified by:
listIterator in interface FloatBigList
Overrides:
listIterator in class AbstractFloatBigList
Returns:
a big-list iterator over the elements in this big list.
See Also:
List.listIterator()

addAll

public boolean addAll(long index,
                      Collection<? extends Float> c)
Description copied from interface: BigList
Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).

Specified by:
addAll in interface BigList<Float>
Overrides:
addAll in class AbstractFloatBigList
Parameters:
index - index at which to insert the first element from the specified collection.
c - collection containing elements to be added to this big list.
Returns:
true if this big list changed as a result of the call
See Also:
List.addAll(int, Collection)

listIterator

public FloatBigListIterator listIterator(long index)
Description copied from interface: FloatBigList
Returns a type-specific list iterator on this type-specific big list starting at a given index.

Specified by:
listIterator in interface BigList<Float>
Specified by:
listIterator in interface FloatBigList
Overrides:
listIterator in class AbstractFloatBigList
Parameters:
index - index of first element to be returned from the big-list iterator.
Returns:
a big-list iterator of the elements in this big list, starting at the specified position in this big list.
See Also:
BigList.listIterator(long)

subList

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

Note that this specification strengthens the one given in BigList.subList(long,long).

Specified by:
subList in interface BigList<Float>
Specified by:
subList in interface FloatBigList
Overrides:
subList in class AbstractFloatBigList
Parameters:
from - the starting element (inclusive).
to - the ending element (exclusive).
Returns:
a big sublist view of this big list.
See Also:
BigList.subList(long,long)

contains

public boolean contains(float key)
Specified by:
contains in interface FloatCollection
Overrides:
contains in class AbstractFloatBigList
See Also:
Collection.contains(Object)

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
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray()

removeElements

public void removeElements(long from,
                           long to)
Description copied from class: AbstractFloatBigList
Removes elements of this type-specific big 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 FloatBigList
Overrides:
removeElements in class AbstractFloatBigList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

toFloatArray

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

Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toFloatArray in interface FloatCollection
Overrides:
toFloatArray in class AbstractFloatCollection
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

add

public void add(long index,
                float key)
Specified by:
add in interface FloatBigList
Overrides:
add in class AbstractFloatBigList
See Also:
List.add(int,Object)

addAll

public boolean addAll(long index,
                      FloatCollection c)
Description copied from class: AbstractFloatBigList
Delegates to a more generic method.

Specified by:
addAll in interface FloatBigList
Overrides:
addAll in class AbstractFloatBigList
See Also:
List.addAll(int,java.util.Collection)

addAll

public boolean addAll(long index,
                      FloatBigList c)
Description copied from class: AbstractFloatBigList
Delegates to a more generic method.

Specified by:
addAll in interface FloatBigList
Overrides:
addAll in class AbstractFloatBigList
See Also:
List.addAll(int,java.util.Collection)

add

public boolean add(float key)
Specified by:
add in interface FloatCollection
Overrides:
add in class AbstractFloatBigList
See Also:
Collection.add(Object)

addAll

public boolean addAll(FloatBigList c)
Specified by:
addAll in interface FloatBigList
Overrides:
addAll in class AbstractFloatBigList
See Also:
List.addAll(int,java.util.Collection)

getFloat

public float getFloat(long index)
Specified by:
getFloat in interface FloatBigList
See Also:
BigList.get(long)

indexOf

public long indexOf(float k)
Specified by:
indexOf in interface FloatBigList
Overrides:
indexOf in class AbstractFloatBigList
See Also:
BigList.indexOf(Object)

lastIndexOf

public long lastIndexOf(float k)
Specified by:
lastIndexOf in interface FloatBigList
Overrides:
lastIndexOf in class AbstractFloatBigList
See Also:
BigList.lastIndexOf(Object)

removeFloat

public float removeFloat(long index)
Specified by:
removeFloat in interface FloatBigList
Overrides:
removeFloat in class AbstractFloatBigList
See Also:
BigList.remove(long)

set

public float set(long index,
                 float k)
Specified by:
set in interface FloatBigList
Overrides:
set in class AbstractFloatBigList
See Also:
BigList.set(long,Object)

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 AbstractFloatBigList
Parameters:
c - a type-specific collection.
Returns:
true if this collection changed as a result of the call.
See Also:
Collection.addAll(Collection)

containsAll

public boolean containsAll(FloatCollection c)
Description copied from class: AbstractFloatCollection
Checks whether this collection contains all elements from the given type-specific collection.

Specified by:
containsAll in interface FloatCollection
Overrides:
containsAll in class AbstractFloatCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection contains all elements of the argument.
See Also:
Collection.containsAll(Collection)

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.
See Also:
Collection.removeAll(Collection)

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.
See Also:
Collection.retainAll(Collection)

isEmpty

public boolean isEmpty()
Description copied from interface: Stack
Checks whether the stack is empty.

Specified by:
isEmpty in interface Stack<Float>
Specified by:
isEmpty in interface Collection<Float>
Overrides:
isEmpty in class AbstractFloatCollection
Returns:
true if the stack is empty.

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: FloatCollection
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.

Warning: Note that, contrarily to Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.

Specified by:
toArray in interface FloatCollection
Specified by:
toArray in interface Collection<Float>
Overrides:
toArray in class AbstractFloatCollection
Parameters:
a - if this array is big enough, it will be used to store this collection.
Returns:
a primitive type array containing the items of this collection.
See Also:
Collection.toArray(Object[])

containsAll

public boolean containsAll(Collection<?> c)
Description copied from class: AbstractFloatCollection
Checks whether this collection contains all elements from the given collection.

Specified by:
containsAll in interface Collection<Float>
Overrides:
containsAll in class AbstractFloatCollection
Parameters:
c - a collection.
Returns:
true if this collection contains all elements of the argument.

addAll

public boolean addAll(Collection<? extends Float> c)
Description copied from class: AbstractFloatBigList
Delegates to a more generic method.

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

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

clear

public void clear()
Specified by:
clear in interface Collection<Float>
Overrides:
clear in class AbstractCollection<Float>

hashCode

public int hashCode()
Description copied from class: AbstractFloatBigList
Returns the hash code for this big list, which is identical to List.hashCode().

Specified by:
hashCode in interface Collection<Float>
Overrides:
hashCode in class AbstractFloatBigList
Returns:
the hash code for this big list.


Copyright © 2011. All Rights Reserved.