Interface BooleanBigList

All Superinterfaces:
BigList<Boolean>, BooleanCollection, BooleanIterable, Collection<Boolean>, Comparable<BigList<? extends Boolean>>, Iterable<Boolean>, Size64
All Known Implementing Classes:
AbstractBooleanBigList, AbstractBooleanBigList.BooleanRandomAccessSubList, AbstractBooleanBigList.BooleanSubList, BooleanBigArrayBigList, BooleanBigLists.EmptyBigList, BooleanBigLists.ListBigList, BooleanBigLists.Singleton, BooleanBigLists.SynchronizedBigList, BooleanBigLists.UnmodifiableBigList

public interface BooleanBigList extends BigList<Boolean>, BooleanCollection, Comparable<BigList<? extends Boolean>>
A type-specific BigList; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens iterator(), listIterator(), listIterator(long) and subList(long,long).

Besides polymorphic methods, this interfaces specifies methods to copy into an array or remove contiguous sublists. Although the abstract implementation of this interface provides simple, one-by-one implementations of these methods, it is expected that concrete implementation override them with optimized versions.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(long index, boolean key)
    Inserts the specified element at the specified position in this type-specific big list (optional operation).
    void
    add(long index, Boolean key)
    Deprecated.
    Please use the corresponding type-specific method instead.
    default boolean
    addAll(long index, BooleanBigList l)
    Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).
    boolean
    addAll(long index, BooleanCollection c)
    Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).
    default boolean
    addAll(long index, BooleanList l)
    Inserts all of the elements in the specified type-specific list into this type-specific big list at the specified position (optional operation).
    default boolean
    Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).
    default boolean
    Appends all of the elements in the specified type-specific list to the end of this type-specific big list (optional operation).
    void
    addElements(long index, boolean[][] a)
    Add (hopefully quickly) elements to this type-specific big list.
    void
    addElements(long index, boolean[][] a, long offset, long length)
    Add (hopefully quickly) elements to this type-specific big list.
    get(long index)
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    getBoolean(long index)
    Returns the element at the specified position.
    void
    getElements(long from, boolean[][] a, long offset, long length)
    Copies (hopefully quickly) elements of this type-specific big list into the given big array.
    default void
    getElements(long from, boolean[] a, int offset, int length)
    Copies (hopefully quickly) elements of this type-specific big list into the given array.
    long
    indexOf(boolean 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.
    Returns a type-specific iterator on the elements of this list.
    long
    lastIndexOf(boolean 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.
    Returns a type-specific big-list iterator on this type-specific big list.
    listIterator(long index)
    Returns a type-specific list iterator on this type-specific big list starting at a given index.
    remove(long index)
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean
    removeBoolean(long index)
    Removes the element at the specified position.
    void
    removeElements(long from, long to)
    Removes (hopefully quickly) elements of this type-specific big list.
    boolean
    set(long index, boolean k)
    Replaces the element at the specified position in this big list with the specified element (optional operation).
    set(long index, Boolean k)
    Deprecated.
    Please use the corresponding type-specific method instead.
    default void
    setElements(boolean[][] a)
    Set (hopefully quickly) elements to match the array given.
    default void
    setElements(long index, boolean[][] a)
    Set (hopefully quickly) elements to match the array given.
    default void
    setElements(long index, boolean[][] a, long offset, long length)
    Set (hopefully quickly) elements to match the array given.
    Returns a type-specific spliterator on the elements of this big-list.
    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.

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

    addAll, size, size

    Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection

    add, add, addAll, contains, contains, containsAll, rem, remove, removeAll, removeIf, removeIf, retainAll, toArray, toBooleanArray, toBooleanArray

    Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanIterable

    forEach, forEach

    Methods inherited from interface java.lang.Comparable

    compareTo

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

    size64
  • Method Details

    • iterator

      Returns a type-specific iterator on the elements of this list.
      Specified by:
      iterator in interface BooleanCollection
      Specified by:
      iterator in interface BooleanIterable
      Specified by:
      iterator in interface Collection<Boolean>
      Specified by:
      iterator in interface Iterable<Boolean>
      Returns:
      a type-specific iterator on the elements of this collection.
      See Also:
      API Notes:
      This specification strengthens the one given in Collection.iterator().
    • listIterator

      BooleanBigListIterator listIterator()
      Returns a type-specific big-list iterator on this type-specific big list.
      Specified by:
      listIterator in interface BigList<Boolean>
      Returns:
      a big-list iterator over the elements in this big list.
      See Also:
      API Notes:
      This specification strengthens the one given in BigList.listIterator().
    • listIterator

      BooleanBigListIterator 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 BigList<Boolean>
      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:
      API Notes:
      This specification strengthens the one given in BigList.listIterator(long).
    • spliterator

      default BooleanSpliterator spliterator()
      Returns a type-specific spliterator on the elements of this big-list.

      BigList spliterators must report at least Spliterator.SIZED and Spliterator.ORDERED.

      See List.spliterator() for more documentation on the requirements of the returned spliterator (despite BigList not being a List, most of the same requirements apply.

      Specified by:
      spliterator in interface BooleanCollection
      Specified by:
      spliterator in interface BooleanIterable
      Specified by:
      spliterator in interface Collection<Boolean>
      Specified by:
      spliterator in interface Iterable<Boolean>
      Returns:
      a type-specific spliterator on the elements of this collection.
      Since:
      8.5.0
      API Notes:
      This is generally the only spliterator method subclasses should override.
      Implementation Specification:
      The default implementation returns a late-binding spliterator (see Spliterator for documentation on what binding policies mean).
      • For RandomAccess lists, this will return a spliterator that calls the type-specific get(long) method on the appropriate indexes.
      • Otherwise, the spliterator returned will wrap this instance's type specific iterator().

      In either case, the spliterator reports Spliterator.SIZED, Spliterator.SUBSIZED, and Spliterator.ORDERED.

      Implementation Notes:
      As the non-RandomAccess case is based on the iterator, and Iterator is an inherently linear API, the returned spliterator will yield limited performance gains when run in parallel contexts, as the returned spliterator's trySplit() will have linear runtime.

      For RandomAccess lists, the parallel performance should be reasonable assuming get(long) is truly constant time like RandomAccess suggests.

    • subList

      BooleanBigList 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.
      Specified by:
      subList in interface BigList<Boolean>
      Parameters:
      from - the starting element (inclusive).
      to - the ending element (exclusive).
      Returns:
      a big sublist view of this big list.
      See Also:
      API Notes:
      This specification strengthens the one given in BigList.subList(long,long).
    • getElements

      void getElements(long from, boolean[][] a, long offset, long length)
      Copies (hopefully quickly) elements of this type-specific big list into the given big array.
      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.
    • getElements

      default void getElements(long from, boolean[] a, int offset, int length)
      Copies (hopefully quickly) elements of this type-specific big list into the given array.
      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

      void removeElements(long from, long to)
      Removes (hopefully quickly) elements of this type-specific big list.
      Parameters:
      from - the start index (inclusive).
      to - the end index (exclusive).
    • addElements

      void addElements(long index, boolean[][] a)
      Add (hopefully quickly) elements to this type-specific big list.
      Parameters:
      index - the index at which to add elements.
      a - the big array containing the elements.
    • addElements

      void addElements(long index, boolean[][] a, long offset, long length)
      Add (hopefully quickly) elements to this type-specific big list.
      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.
    • setElements

      default void setElements(boolean[][] a)
      Set (hopefully quickly) elements to match the array given.
      Parameters:
      a - the big array containing the elements.
      Since:
      8.5.0
    • setElements

      default void setElements(long index, boolean[][] a)
      Set (hopefully quickly) elements to match the array given.
      Parameters:
      index - the index at which to start setting elements.
      a - the big array containing the elements.
      Since:
      8.5.0
    • setElements

      default void setElements(long index, boolean[][] a, long offset, long length)
      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.
      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.
      Since:
      8.5.0
    • add

      void add(long index, boolean key)
      Inserts the specified element at the specified position in this type-specific big list (optional operation).
      See Also:
    • addAll

      boolean addAll(long index, BooleanCollection c)
      Inserts all of the elements in the specified type-specific collection into this type-specific big list at the specified position (optional operation).
      See Also:
    • getBoolean

      boolean getBoolean(long index)
      Returns the element at the specified position.
      See Also:
    • removeBoolean

      boolean removeBoolean(long index)
      Removes the element at the specified position.
      See Also:
    • set

      boolean set(long index, boolean k)
      Replaces the element at the specified position in this big list with the specified element (optional operation).
      See Also:
    • indexOf

      long indexOf(boolean 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.
      See Also:
    • lastIndexOf

      long lastIndexOf(boolean 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.
      See Also:
    • add

      @Deprecated void add(long index, Boolean key)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Inserts the specified element at the specified position in this big list (optional operation).
      Specified by:
      add in interface BigList<Boolean>
      Parameters:
      index - a position in the big list.
      key - an element to be inserted.
      See Also:
    • get

      @Deprecated Boolean get(long index)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Returns the element at the specified position.
      Specified by:
      get in interface BigList<Boolean>
      Parameters:
      index - a position in the big list.
      Returns:
      the element at the specified position.
      See Also:
    • indexOf

      @Deprecated long indexOf(Object o)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      Specified by:
      indexOf in interface BigList<Boolean>
      Parameters:
      o - the object to search for.
      Returns:
      the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      See Also:
    • lastIndexOf

      @Deprecated long lastIndexOf(Object o)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Returns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      Specified by:
      lastIndexOf in interface BigList<Boolean>
      Parameters:
      o - the object to search for.
      Returns:
      the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      See Also:
    • remove

      @Deprecated Boolean remove(long index)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Removes the element at the specified position.
      Specified by:
      remove in interface BigList<Boolean>
      Parameters:
      index - a position in the big list.
      Returns:
      the element previously at the specified position.
      See Also:
    • set

      @Deprecated Boolean set(long index, Boolean k)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Replaces the element at the specified position in this big list with the specified element (optional operation).
      Specified by:
      set in interface BigList<Boolean>
      Parameters:
      index - a position in the big list.
      k - the element to be stored at the specified position.
      Returns:
      the element previously at the specified positions.
      See Also:
    • addAll

      default boolean addAll(long index, BooleanBigList l)
      Inserts all of the elements in the specified type-specific big list into this type-specific big list at the specified position (optional operation).
      See Also:
      API Notes:
      This method exists only for the sake of efficiency: override are expected to use getElements(long, boolean[][], long, long)/addElements(long, boolean[][]).
      Implementation Specification:
      This method delegates to the one accepting a collection, but it might be implemented more efficiently.
    • addAll

      default boolean addAll(BooleanBigList l)
      Appends all of the elements in the specified type-specific big list to the end of this type-specific big list (optional operation).
      See Also:
      Implementation Specification:
      This method delegates to the index-based version, passing BigList.size() as first argument.
    • addAll

      default boolean addAll(long index, BooleanList l)
      Inserts all of the elements in the specified type-specific list into this type-specific big list at the specified position (optional operation).
      See Also:
      API Notes:
      This method exists only for the sake of efficiency: override are expected to use getElements(long, boolean[][], long, long)/addElements(long, boolean[][]).
      Implementation Specification:
      This method delegates to the one accepting a collection, but it might be implemented more efficiently.
    • addAll

      default boolean addAll(BooleanList l)
      Appends all of the elements in the specified type-specific list to the end of this type-specific big list (optional operation).
      See Also:
      Implementation Specification:
      This method delegates to the index-based version, passing BigList.size() as first argument.