Class AbstractFloatBigList

java.lang.Object
java.util.AbstractCollection<Float>
it.unimi.dsi.fastutil.floats.AbstractFloatCollection
it.unimi.dsi.fastutil.floats.AbstractFloatBigList
All Implemented Interfaces:
it.unimi.dsi.fastutil.BigList<Float>, FloatBigList, it.unimi.dsi.fastutil.floats.FloatCollection, it.unimi.dsi.fastutil.floats.FloatIterable, it.unimi.dsi.fastutil.floats.FloatStack, it.unimi.dsi.fastutil.Size64, it.unimi.dsi.fastutil.Stack<Float>, Comparable<it.unimi.dsi.fastutil.BigList<? extends Float>>, Iterable<Float>, Collection<Float>
Direct Known Subclasses:
AbstractFloatBigList.FloatSubList, FloatBigArrayBigList, FloatBigLists.ListBigList, FloatBigLists.Singleton, FloatMappedBigList

public abstract class AbstractFloatBigList extends it.unimi.dsi.fastutil.floats.AbstractFloatCollection implements FloatBigList, it.unimi.dsi.fastutil.floats.FloatStack
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.Float>)) 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(float k)
    void
    add(long index, float k)
    Inserts the specified element at the specified position in this type-specific big list (optional operation).
    void
    add(long index, Float ok)
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    addAll(long index, it.unimi.dsi.fastutil.floats.FloatCollection 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 Float> c)
    Adds all of the elements in the specified collection to this list (optional operation).
    boolean
    addAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
    boolean
    addAll(Collection<? extends Float> c)
    void
    addElements(long index, float[][] a)
    Add (hopefully quickly) elements to this type-specific big list.
    void
    addElements(long index, float[][] a, long offset, long length)
    Add (hopefully quickly) elements to this type-specific big list.
    void
    int
    compareTo(it.unimi.dsi.fastutil.BigList<? extends Float> l)
    Compares this big list to another object.
    boolean
    contains(float k)
    Returns true if this list contains the specified element.
    it.unimi.dsi.fastutil.doubles.DoubleSpliterator
     
    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
    forEach(it.unimi.dsi.fastutil.floats.FloatConsumer action)
    get(long index)
    Deprecated.
    Please use the corresponding type-specific method instead.
    void
    getElements(long from, float[][] 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(float 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.floats.FloatBigListIterator
    Returns a type-specific iterator on the elements of this list.
    long
    lastIndexOf(float 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.floats.FloatBigListIterator
    Returns a type-specific big-list iterator on this type-specific big list.
    it.unimi.dsi.fastutil.floats.FloatBigListIterator
    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.
    float
    peekFloat(int i)
     
    pop()
    Deprecated.
    Please use the corresponding type-specific method instead.
    float
     
    void
    push(float o)
     
    void
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    rem(float 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.
    void
    removeElements(long from, long to)
    Removes (hopefully quickly) elements of this type-specific big list.
    float
    removeFloat(long i)
    Removes the element at the specified position.
    float
    set(long index, float k)
    Replaces the element at the specified position in this big list with the specified element (optional operation).
    set(long index, Float ok)
    Deprecated.
    Please use the corresponding type-specific method instead.
    void
    setElements(long index, float[][] 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.
    float
     
     

    Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection

    add, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toFloatArray, toFloatArray

    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.floats.FloatBigList

    addAll, addAll, addAll, addAll, getElements, getFloat, setElements, setElements, spliterator

    Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection

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

    Methods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable

    forEach, forEach

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

    size64

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

    isEmpty
  • Constructor Details

    • AbstractFloatBigList

      protected AbstractFloatBigList()
  • 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, float k)
      Inserts the specified element at the specified position in this type-specific big list (optional operation).
      Specified by:
      add in interface FloatBigList
      See Also:
      • BigList.add(long,Object)
    • add

      public boolean add(float k)
      Specified by:
      add in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      add in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • removeFloat

      public float removeFloat(long i)
      Removes the element at the specified position.
      Specified by:
      removeFloat in interface FloatBigList
      See Also:
      • BigList.remove(long)
    • set

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

      public boolean addAll(long index, Collection<? extends Float> 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<Float>
    • addAll

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

      public it.unimi.dsi.fastutil.floats.FloatBigListIterator iterator()
      Returns a type-specific iterator on the elements of this list.
      Specified by:
      iterator in interface Collection<Float>
      Specified by:
      iterator in interface FloatBigList
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
      Specified by:
      iterator in interface Iterable<Float>
      Specified by:
      iterator in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
      See Also:
    • listIterator

      public it.unimi.dsi.fastutil.floats.FloatBigListIterator listIterator()
      Returns a type-specific big-list iterator on this type-specific big list.
      Specified by:
      listIterator in interface it.unimi.dsi.fastutil.BigList<Float>
      Specified by:
      listIterator in interface FloatBigList
      See Also:
      • BigList.listIterator()
    • listIterator

      public it.unimi.dsi.fastutil.floats.FloatBigListIterator 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<Float>
      Specified by:
      listIterator in interface FloatBigList
      See Also:
      • BigList.listIterator(long)
    • doubleSpliterator

      public it.unimi.dsi.fastutil.doubles.DoubleSpliterator doubleSpliterator()
      Specified by:
      doubleSpliterator in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Specified by:
      doubleSpliterator in interface it.unimi.dsi.fastutil.floats.FloatIterable
    • contains

      public boolean contains(float k)
      Returns true if this list contains the specified element.
      Specified by:
      contains in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
      See Also:
    • indexOf

      public long indexOf(float k)
      Description copied from interface: FloatBigList
      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 FloatBigList
      See Also:
      • BigList.indexOf(Object)
    • lastIndexOf

      public long lastIndexOf(float k)
      Description copied from interface: FloatBigList
      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 FloatBigList
      See Also:
      • BigList.lastIndexOf(Object)
    • size

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

      public void forEach(it.unimi.dsi.fastutil.floats.FloatConsumer action)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.floats.FloatIterable
    • 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 FloatBigList
      Parameters:
      from - the start index (inclusive).
      to - the end index (exclusive).
    • addElements

      public void addElements(long index, float[][] 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 FloatBigList
      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, float[][] a)
      Add (hopefully quickly) elements to this type-specific big list.
      Specified by:
      addElements in interface FloatBigList
      Parameters:
      index - the index at which to add elements.
      a - the big array containing the elements.
    • getElements

      public void getElements(long from, float[][] 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 FloatBigList
      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, float[][] a, long offset, long length)
      Description copied from interface: FloatBigList
      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 FloatBigList
      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<Float>
      Overrides:
      clear in class AbstractCollection<Float>
    • size

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

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

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

      public int compareTo(it.unimi.dsi.fastutil.BigList<? extends Float> 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 Float>>
      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(float o)
      Specified by:
      push in interface it.unimi.dsi.fastutil.floats.FloatStack
    • popFloat

      public float popFloat()
      Specified by:
      popFloat in interface it.unimi.dsi.fastutil.floats.FloatStack
    • topFloat

      public float topFloat()
      Specified by:
      topFloat in interface it.unimi.dsi.fastutil.floats.FloatStack
    • peekFloat

      public float peekFloat(int i)
      Specified by:
      peekFloat in interface it.unimi.dsi.fastutil.floats.FloatStack
    • rem

      public boolean rem(float 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.floats.FloatCollection
      Overrides:
      rem in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
      See Also:
    • addAll

      public boolean addAll(long index, it.unimi.dsi.fastutil.floats.FloatCollection 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 FloatBigList
      See Also:
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.floats.FloatCollection c)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.floats.FloatCollection
      Overrides:
      addAll in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
    • add

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

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

      @Deprecated public Float get(long index)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      get in interface it.unimi.dsi.fastutil.BigList<Float>
      Specified by:
      get in interface FloatBigList
    • 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<Float>
      Specified by:
      indexOf in interface FloatBigList
    • 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<Float>
      Specified by:
      lastIndexOf in interface FloatBigList
    • remove

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

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

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

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

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

      public String toString()
      Overrides:
      toString in class it.unimi.dsi.fastutil.floats.AbstractFloatCollection