Class AbstractDoubleBigList

java.lang.Object
java.util.AbstractCollection<Double>
it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
it.unimi.dsi.fastutil.doubles.AbstractDoubleBigList
All Implemented Interfaces:
it.unimi.dsi.fastutil.BigList<Double>, DoubleBigList, it.unimi.dsi.fastutil.doubles.DoubleCollection, it.unimi.dsi.fastutil.doubles.DoubleIterable, it.unimi.dsi.fastutil.doubles.DoubleStack, it.unimi.dsi.fastutil.Size64, it.unimi.dsi.fastutil.Stack<Double>, Comparable<it.unimi.dsi.fastutil.BigList<? extends Double>>, Iterable<Double>, Collection<Double>
Direct Known Subclasses:
AbstractDoubleBigList.DoubleSubList, DoubleBigArrayBigList, DoubleBigLists.ListBigList, DoubleBigLists.Singleton, DoubleMappedBigList

public abstract class AbstractDoubleBigList extends it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection implements DoubleBigList, it.unimi.dsi.fastutil.doubles.DoubleStack
An abstract class providing basic methods for big lists implementing a type-specific big list interface.

Most of the methods in this class are optimized with the assumption that the List will have have constant-time random access. If this is not the case, you should probably at least override listIterator(long) and the xAll() methods (such as addAll(long, java.util.Collection<? extends java.lang.Double>)) with a more appropriate iteration scheme. Note the subList(long, long) method is cognizant of random-access or not, so that need not be reimplemented.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
    A class implementing a sublist view.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(double k)
    void
    add(long index, double k)
    Inserts the specified element at the specified position in this type-specific big list (optional operation).
    void
    add(long index, Double ok)
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    addAll(long index, it.unimi.dsi.fastutil.doubles.DoubleCollection c)
    Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).
    boolean
    addAll(long index, Collection<? extends Double> c)
    Adds all of the elements in the specified collection to this list (optional operation).
    boolean
    addAll(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
    boolean
    addAll(Collection<? extends Double> c)
    void
    addElements(long index, double[][] a)
    Add (hopefully quickly) elements to this type-specific big list.
    void
    addElements(long index, double[][] a, long offset, long length)
    Add (hopefully quickly) elements to this type-specific big list.
    void
    int
    compareTo(it.unimi.dsi.fastutil.BigList<? extends Double> l)
    Compares this big list to another object.
    boolean
    contains(double k)
    Returns true if this list contains the specified element.
    protected void
    ensureIndex(long index)
    Ensures that the given index is nonnegative and not greater than this big-list size.
    protected void
    Ensures that the given index is nonnegative and smaller than this big-list size.
    boolean
     
    void
    get(long index)
    Deprecated.
    Please use the corresponding type-specific method instead.
    void
    getElements(long from, double[][] a, long offset, long length)
    Copies (hopefully quickly) elements of this type-specific big list into the given big array.
    int
    Returns the hash code for this big list, which is identical to List.hashCode().
    long
    indexOf(double k)
    Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
    long
    Deprecated.
    Please use the corresponding type-specific method instead.
    it.unimi.dsi.fastutil.doubles.DoubleBigListIterator
    Returns a type-specific iterator on the elements of this list.
    long
    lastIndexOf(double k)
    Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
    long
    Deprecated.
    Please use the corresponding type-specific method instead.
    it.unimi.dsi.fastutil.doubles.DoubleBigListIterator
    Returns a type-specific big-list iterator on this type-specific big list.
    it.unimi.dsi.fastutil.doubles.DoubleBigListIterator
    listIterator(long index)
    Returns a type-specific list iterator on this type-specific big list starting at a given index.
    peek(int i)
    Deprecated.
    Please use the corresponding type-specific method instead.
    double
    peekDouble(int i)
     
    pop()
    Deprecated.
    Please use the corresponding type-specific method instead.
    double
     
    void
    push(double o)
     
    void
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    rem(double k)
    Removes a single instance of the specified element from this collection, if it is present (optional operation).
    remove(long index)
    Deprecated.
    Please use the corresponding type-specific method instead.
    double
    removeDouble(long i)
    Removes the element at the specified position.
    void
    removeElements(long from, long to)
    Removes (hopefully quickly) elements of this type-specific big list.
    double
    set(long index, double k)
    Replaces the element at the specified position in this big list with the specified element (optional operation).
    set(long index, Double ok)
    Deprecated.
    Please use the corresponding type-specific method instead.
    void
    setElements(long index, double[][] a, long offset, long length)
    Set (hopefully quickly) elements to match the array given.
    int
    Deprecated.
    Please use Size64.size64() instead.
    void
    size(long size)
     
    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.
    top()
    Deprecated.
    Please use the corresponding type-specific method instead.
    double
     
     

    Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection

    add, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toDoubleArray, toDoubleArray

    Methods inherited from class java.util.AbstractCollection

    isEmpty, toArray, toArray

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toArray

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleBigList

    addAll, addAll, addAll, addAll, getDouble, getElements, setElements, setElements, spliterator

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection

    add, contains, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toDoubleArray, toDoubleArray

    Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable

    forEach, forEach

    Methods inherited from interface it.unimi.dsi.fastutil.Size64

    size64

    Methods inherited from interface it.unimi.dsi.fastutil.Stack

    isEmpty
  • Constructor Details

    • AbstractDoubleBigList

      protected AbstractDoubleBigList()
  • Method Details

    • ensureIndex

      protected void ensureIndex(long index)
      Ensures that the given index is nonnegative and not greater than this big-list size.
      Parameters:
      index - an index.
      Throws:
      IndexOutOfBoundsException - if the given index is negative or greater than this big-list size.
    • ensureRestrictedIndex

      protected void ensureRestrictedIndex(long index)
      Ensures that the given index is nonnegative and smaller than this big-list size.
      Parameters:
      index - an index.
      Throws:
      IndexOutOfBoundsException - if the given index is negative or not smaller than this big-list size.
    • add

      public void add(long index, double k)
      Inserts the specified element at the specified position in this type-specific big list (optional operation).
      Specified by:
      add in interface DoubleBigList
      See Also:
      • BigList.add(long,Object)
    • add

      public boolean add(double k)
      Specified by:
      add in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      add in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • removeDouble

      public double removeDouble(long i)
      Removes the element at the specified position.
      Specified by:
      removeDouble in interface DoubleBigList
      See Also:
      • BigList.remove(long)
    • set

      public double set(long index, double k)
      Replaces the element at the specified position in this big list with the specified element (optional operation).
      Specified by:
      set in interface DoubleBigList
      See Also:
      • BigList.set(long,Object)
    • addAll

      public boolean addAll(long index, Collection<? extends Double> c)
      Adds all of the elements in the specified collection to this list (optional operation).
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.BigList<Double>
    • addAll

      public boolean addAll(Collection<? extends Double> c)
      Specified by:
      addAll in interface Collection<Double>
      Overrides:
      addAll in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • iterator

      public it.unimi.dsi.fastutil.doubles.DoubleBigListIterator iterator()
      Returns a type-specific iterator on the elements of this list.
      Specified by:
      iterator in interface Collection<Double>
      Specified by:
      iterator in interface DoubleBigList
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.doubles.DoubleIterable
      Specified by:
      iterator in interface Iterable<Double>
      Specified by:
      iterator in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
      See Also:
    • listIterator

      public it.unimi.dsi.fastutil.doubles.DoubleBigListIterator listIterator()
      Returns a type-specific big-list iterator on this type-specific big list.
      Specified by:
      listIterator in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      listIterator in interface DoubleBigList
      See Also:
      • BigList.listIterator()
    • listIterator

      public it.unimi.dsi.fastutil.doubles.DoubleBigListIterator listIterator(long index)
      Returns a type-specific list iterator on this type-specific big list starting at a given index.
      Specified by:
      listIterator in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      listIterator in interface DoubleBigList
      See Also:
      • BigList.listIterator(long)
    • contains

      public boolean contains(double k)
      Returns true if this list contains the specified element.
      Specified by:
      contains in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
      See Also:
    • indexOf

      public long indexOf(double k)
      Description copied from interface: DoubleBigList
      Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
      Specified by:
      indexOf in interface DoubleBigList
      See Also:
      • BigList.indexOf(Object)
    • lastIndexOf

      public long lastIndexOf(double k)
      Description copied from interface: DoubleBigList
      Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
      Specified by:
      lastIndexOf in interface DoubleBigList
      See Also:
      • BigList.lastIndexOf(Object)
    • size

      public void size(long size)
      Specified by:
      size in interface it.unimi.dsi.fastutil.BigList<Double>
    • 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.
      Specified by:
      subList in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      subList in interface DoubleBigList
      See Also:
      • BigList.subList(long,long)
    • forEach

      public void forEach(DoubleConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.doubles.DoubleIterable
    • removeElements

      public void removeElements(long from, long to)
      Removes (hopefully quickly) elements of this type-specific big list.

      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
      Parameters:
      from - the start index (inclusive).
      to - the end index (exclusive).
    • addElements

      public void addElements(long index, double[][] a, long offset, long length)
      Add (hopefully quickly) elements to this type-specific big list.

      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 DoubleBigList
      Parameters:
      index - the index at which to add elements.
      a - the big array containing the elements.
      offset - the offset of the first element to add.
      length - the number of elements to add.
    • addElements

      public void addElements(long index, double[][] a)
      Add (hopefully quickly) elements to this type-specific big list.
      Specified by:
      addElements in interface DoubleBigList
      Parameters:
      index - the index at which to add elements.
      a - the big array containing the elements.
    • getElements

      public void getElements(long from, double[][] a, long offset, long length)
      Copies (hopefully quickly) elements of this type-specific big list into the given big array.

      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 DoubleBigList
      Parameters:
      from - the start index (inclusive).
      a - the destination big array.
      offset - the offset into the destination big array where to store the first element copied.
      length - the number of elements to be copied.
    • setElements

      public void setElements(long index, double[][] a, long offset, long length)
      Description copied from interface: DoubleBigList
      Set (hopefully quickly) elements to match the array given. Sets each in this list to the corresponding elements in the array, as if by
       ListIterator iter = listIterator(index);
       long i = 0;
       while (i < length) {
         iter.next();
         iter.set(BigArrays.get(a, offset + i++);
       }
       
      However, the exact implementation may be more efficient, taking into account whether random access is faster or not, or at the discretion of subclasses, abuse internals.
      Specified by:
      setElements in interface DoubleBigList
      Parameters:
      index - the index at which to start setting elements.
      a - the big array containing the elements.
      offset - the offset of the first element to add.
      length - the number of elements to add.
    • clear

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

      @Deprecated public int size()
      Deprecated.
      Please use Size64.size64() instead.
      Specified by:
      size in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      size in interface Collection<Double>
      Specified by:
      size in interface it.unimi.dsi.fastutil.Size64
      Specified by:
      size in class AbstractCollection<Double>
    • hashCode

      public int hashCode()
      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 Object
      Returns:
      the hash code for this big list.
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<Double>
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(it.unimi.dsi.fastutil.BigList<? extends Double> l)
      Compares this big list to another object. If the argument is a BigList, this method performs a lexicographical comparison; otherwise, it throws a ClassCastException.
      Specified by:
      compareTo in interface Comparable<it.unimi.dsi.fastutil.BigList<? extends Double>>
      Parameters:
      l - a big list.
      Returns:
      if the argument is a BigList, a negative integer, zero, or a positive integer as this list is lexicographically less than, equal to, or greater than the argument.
      Throws:
      ClassCastException - if the argument is not a big list.
    • push

      public void push(double o)
      Specified by:
      push in interface it.unimi.dsi.fastutil.doubles.DoubleStack
    • popDouble

      public double popDouble()
      Specified by:
      popDouble in interface it.unimi.dsi.fastutil.doubles.DoubleStack
    • topDouble

      public double topDouble()
      Specified by:
      topDouble in interface it.unimi.dsi.fastutil.doubles.DoubleStack
    • peekDouble

      public double peekDouble(int i)
      Specified by:
      peekDouble in interface it.unimi.dsi.fastutil.doubles.DoubleStack
    • rem

      public boolean rem(double k)
      Removes a single instance of the specified element from this collection, if it is present (optional operation).
      Specified by:
      rem in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      rem in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
      See Also:
    • addAll

      public boolean addAll(long index, it.unimi.dsi.fastutil.doubles.DoubleCollection c)
      Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).
      Specified by:
      addAll in interface DoubleBigList
      See Also:
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.doubles.DoubleCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.doubles.DoubleCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
    • add

      @Deprecated public void add(long index, Double ok)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      add in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      add in interface DoubleBigList
    • set

      @Deprecated public Double set(long index, Double ok)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      set in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      set in interface DoubleBigList
    • get

      @Deprecated public Double get(long index)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      get in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      get in interface DoubleBigList
    • indexOf

      @Deprecated public long indexOf(Object ok)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      indexOf in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      indexOf in interface DoubleBigList
    • lastIndexOf

      @Deprecated public long lastIndexOf(Object ok)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      lastIndexOf in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      lastIndexOf in interface DoubleBigList
    • remove

      @Deprecated public Double remove(long index)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      remove in interface it.unimi.dsi.fastutil.BigList<Double>
      Specified by:
      remove in interface DoubleBigList
    • push

      @Deprecated public void push(Double o)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      push in interface it.unimi.dsi.fastutil.doubles.DoubleStack
      Specified by:
      push in interface it.unimi.dsi.fastutil.Stack<Double>
    • pop

      @Deprecated public Double pop()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      pop in interface it.unimi.dsi.fastutil.doubles.DoubleStack
      Specified by:
      pop in interface it.unimi.dsi.fastutil.Stack<Double>
    • top

      @Deprecated public Double top()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      top in interface it.unimi.dsi.fastutil.doubles.DoubleStack
      Specified by:
      top in interface it.unimi.dsi.fastutil.Stack<Double>
    • peek

      @Deprecated public Double peek(int i)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      peek in interface it.unimi.dsi.fastutil.doubles.DoubleStack
      Specified by:
      peek in interface it.unimi.dsi.fastutil.Stack<Double>
    • toString

      public String toString()
      Overrides:
      toString in class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection