it.unimi.dsi.fastutil.doubles
Class DoubleBigLists.ListBigList

java.lang.Object
  extended by java.util.AbstractCollection<Double>
      extended by it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
          extended by it.unimi.dsi.fastutil.doubles.AbstractDoubleBigList
              extended by it.unimi.dsi.fastutil.doubles.DoubleBigLists.ListBigList
All Implemented Interfaces:
BigList<Double>, DoubleBigList, DoubleCollection, DoubleIterable, DoubleStack, Size64, Stack<Double>, Serializable, Comparable<BigList<? extends Double>>, Iterable<Double>, Collection<Double>
Enclosing class:
DoubleBigLists

public static class DoubleBigLists.ListBigList
extends AbstractDoubleBigList
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.doubles.AbstractDoubleBigList
AbstractDoubleBigList.DoubleSubList
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 boolean add(double key)
           
 void add(long index, double key)
           
 boolean addAll(Collection<? extends Double> c)
          Delegates to a more generic method.
 boolean addAll(DoubleBigList c)
           
 boolean addAll(DoubleCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(long index, Collection<? extends Double> c)
          Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
 boolean addAll(long index, DoubleBigList c)
          Delegates to a more generic method.
 boolean addAll(long index, DoubleCollection c)
          Delegates to a more generic method.
 void clear()
           
 boolean contains(double key)
           
 boolean containsAll(Collection<?> c)
          Checks whether this collection contains all elements from the given collection.
 boolean containsAll(DoubleCollection c)
          Checks whether this collection contains all elements from the given type-specific collection.
 double getDouble(long index)
           
 int hashCode()
          Returns the hash code for this big list, which is identical to List.hashCode().
 long indexOf(double k)
           
 boolean isEmpty()
          Checks whether the stack is empty.
 DoubleBigListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 long lastIndexOf(double k)
           
 DoubleBigListIterator listIterator()
          Returns a type-specific big-list iterator on this type-specific big list.
 DoubleBigListIterator 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(DoubleCollection c)
          Remove from this collection all elements in the given type-specific collection.
 double removeDouble(long index)
           
 void removeElements(long from, long to)
          Removes elements of this type-specific big list one-by-one.
 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.
 double set(long index, double 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.
 DoubleBigList 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.
 double[] toDoubleArray()
          Returns a primitive type array containing the items of this collection.
 double[] toDoubleArray(double[] a)
          Returns a primitive type array containing the items of this collection.
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleBigList
add, addAll, addElements, addElements, compareTo, equals, get, getDouble, getElements, indexOf, lastIndexOf, listIterator, peek, peekDouble, pop, popDouble, push, push, rem, remove, remove, removeDouble, set, set, size, top, topDouble, toString
 
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, contains, doubleIterator, rem, remove, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
doubleIterator, 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
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<Double>
Overrides:
size in class AbstractDoubleBigList
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<Double>
Overrides:
size in class AbstractDoubleBigList
Parameters:
size - the new size.

iterator

public DoubleBigListIterator iterator()
Description copied from interface: DoubleCollection
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 DoubleBigList
Specified by:
iterator in interface DoubleCollection
Specified by:
iterator in interface DoubleIterable
Specified by:
iterator in interface Iterable<Double>
Specified by:
iterator in interface Collection<Double>
Overrides:
iterator in class AbstractDoubleBigList
Returns:
a type-specific iterator on the elements of this collection.
See Also:
List.iterator()

listIterator

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

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

addAll

public boolean addAll(long index,
                      Collection<? extends Double> 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<Double>
Overrides:
addAll in class AbstractDoubleBigList
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 DoubleBigListIterator listIterator(long index)
Description copied from interface: DoubleBigList
Returns a type-specific list iterator on this type-specific big list starting at a given index.

Specified by:
listIterator in interface BigList<Double>
Specified by:
listIterator in interface DoubleBigList
Overrides:
listIterator in class AbstractDoubleBigList
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 DoubleBigList subList(long from,
                             long to)
Description copied from interface: DoubleBigList
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<Double>
Specified by:
subList in interface DoubleBigList
Overrides:
subList in class AbstractDoubleBigList
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(double key)
Specified by:
contains in interface DoubleCollection
Overrides:
contains in class AbstractDoubleBigList
See Also:
Collection.contains(Object)

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
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: AbstractDoubleBigList
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 DoubleBigList
Overrides:
removeElements in class AbstractDoubleBigList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

toDoubleArray

public double[] toDoubleArray(double[] a)
Description copied from interface: DoubleCollection
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:
toDoubleArray in interface DoubleCollection
Overrides:
toDoubleArray in class AbstractDoubleCollection
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,
                double key)
Specified by:
add in interface DoubleBigList
Overrides:
add in class AbstractDoubleBigList
See Also:
List.add(int,Object)

addAll

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

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

addAll

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

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

add

public boolean add(double key)
Specified by:
add in interface DoubleCollection
Overrides:
add in class AbstractDoubleBigList
See Also:
Collection.add(Object)

addAll

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

getDouble

public double getDouble(long index)
Specified by:
getDouble in interface DoubleBigList
See Also:
BigList.get(long)

indexOf

public long indexOf(double k)
Specified by:
indexOf in interface DoubleBigList
Overrides:
indexOf in class AbstractDoubleBigList
See Also:
BigList.indexOf(Object)

lastIndexOf

public long lastIndexOf(double k)
Specified by:
lastIndexOf in interface DoubleBigList
Overrides:
lastIndexOf in class AbstractDoubleBigList
See Also:
BigList.lastIndexOf(Object)

removeDouble

public double removeDouble(long index)
Specified by:
removeDouble in interface DoubleBigList
Overrides:
removeDouble in class AbstractDoubleBigList
See Also:
BigList.remove(long)

set

public double set(long index,
                  double k)
Specified by:
set in interface DoubleBigList
Overrides:
set in class AbstractDoubleBigList
See Also:
BigList.set(long,Object)

addAll

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

Specified by:
addAll in interface DoubleCollection
Overrides:
addAll in class AbstractDoubleBigList
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(DoubleCollection c)
Description copied from class: AbstractDoubleCollection
Checks whether this collection contains all elements from the given type-specific collection.

Specified by:
containsAll in interface DoubleCollection
Overrides:
containsAll in class AbstractDoubleCollection
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(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.
See Also:
Collection.removeAll(Collection)

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.
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<Double>
Specified by:
isEmpty in interface Collection<Double>
Overrides:
isEmpty in class AbstractDoubleCollection
Returns:
true if the stack is empty.

toArray

public <T> T[] toArray(T[] a)
Description copied from interface: DoubleCollection
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 DoubleCollection
Specified by:
toArray in interface Collection<Double>
Overrides:
toArray in class AbstractDoubleCollection
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: AbstractDoubleCollection
Checks whether this collection contains all elements from the given collection.

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

addAll

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

Specified by:
addAll in interface Collection<Double>
Overrides:
addAll in class AbstractDoubleBigList
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: 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 Collection<Double>
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 Collection<Double>
Overrides:
retainAll in class AbstractDoubleCollection
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<Double>
Overrides:
clear in class AbstractCollection<Double>

hashCode

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

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