Interface Selection

All Superinterfaces:
it.unimi.dsi.fastutil.ints.IntIterable, Iterable<Integer>
All Known Implementing Classes:
BitmapBackedSelection

public interface Selection extends it.unimi.dsi.fastutil.ints.IntIterable
A selection maintains an ordered set of ints that can be used to filter rows from a table or column. When applying the selection to the data (table, column, etc.) only those rows with indexes included in the selection pass the filter
  • Method Summary

    Modifier and Type
    Method
    Description
    add(int... ints)
    Adds the given integers to the Selection if it is not already present, and does nothing otherwise
    addRange(int start, int end)
    Adds to the current bitmap all integers in [rangeStart,rangeEnd)
    and(Selection otherSelection)
    Returns this Selection object after its data has been intersected with otherSelection
    andNot(Selection otherSelection)
    Implements the set difference operation between the receiver and otherSelection, after updating the receiver
    Returns this selection with all its values cleared
    boolean
    contains(int i)
    Returns true if the index i is selected in this object
    flip(int rangeStart, int rangeEnd)
    Returns a selection with the bits from this selection flipped over the given range
    int
    get(int i)
    Returns the value of the ith element.
    boolean
    Returns true if this selection has no values, and false otherwise
    or(Selection otherSelection)
    Returns this Selection object with its data replaced by the union of its starting data and otherSelection
    removeRange(long start, long end)
    Removes from the current bitmap from all integers in [rangeStart,rangeEnd)
    static Selection
    selectNRowsAtRandom(int n, int max)
    Returns an randomly generated selection of size N where Max is the largest possible value
    int
    Returns the number of integers represented by this Selection
    int[]
    Returns the elements of this selection as an array of ints
    static Selection
    with(int... rows)
    Returns a Selection containing all indexes in the array
    static Selection
    withoutRange(int totalRangeStart, int totalRangeEnd, int excludedRangeStart, int excludedRangeEnd)
    Returns a Selection containing all values from totalRangeStart to totalRangeEnd, except for those in the range from excludedRangeStart to excludedRangeEnd.
    static Selection
    withRange(int start, int end)
    Returns a Selection containing all indexes in the range start (inclusive) to end (exclusive),

    Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterable

    forEach, forEach, forEach, intIterator, intSpliterator, iterator, spliterator
  • Method Details

    • toArray

      int[] toArray()
      Returns the elements of this selection as an array of ints
    • add

      Selection add(int... ints)
      Adds the given integers to the Selection if it is not already present, and does nothing otherwise
    • addRange

      Selection addRange(int start, int end)
      Adds to the current bitmap all integers in [rangeStart,rangeEnd)
      Parameters:
      start - inclusive beginning of range
      end - exclusive ending of range
    • removeRange

      Selection removeRange(long start, long end)
      Removes from the current bitmap from all integers in [rangeStart,rangeEnd)
      Parameters:
      start - inclusive beginning of range
      end - exclusive ending of range
    • size

      int size()
      Returns the number of integers represented by this Selection
    • and

      Selection and(Selection otherSelection)
      Returns this Selection object after its data has been intersected with otherSelection
    • or

      Selection or(Selection otherSelection)
      Returns this Selection object with its data replaced by the union of its starting data and otherSelection
    • andNot

      Selection andNot(Selection otherSelection)
      Implements the set difference operation between the receiver and otherSelection, after updating the receiver
    • isEmpty

      boolean isEmpty()
      Returns true if this selection has no values, and false otherwise
    • clear

      Selection clear()
      Returns this selection with all its values cleared
    • contains

      boolean contains(int i)
      Returns true if the index i is selected in this object
    • get

      int get(int i)
      Returns the value of the ith element. For example, if there are three ints {4, 32, 71} in the selection, get(0) returns 4, get(1) returns 32, and get(2) returns 71

      It can be useful if you need to iterate over the data, although there is also an iterator

    • flip

      Selection flip(int rangeStart, int rangeEnd)
      Returns a selection with the bits from this selection flipped over the given range
    • selectNRowsAtRandom

      static Selection selectNRowsAtRandom(int n, int max)
      Returns an randomly generated selection of size N where Max is the largest possible value
    • with

      static Selection with(int... rows)
      Returns a Selection containing all indexes in the array
    • withRange

      static Selection withRange(int start, int end)
      Returns a Selection containing all indexes in the range start (inclusive) to end (exclusive),
    • withoutRange

      static Selection withoutRange(int totalRangeStart, int totalRangeEnd, int excludedRangeStart, int excludedRangeEnd)
      Returns a Selection containing all values from totalRangeStart to totalRangeEnd, except for those in the range from excludedRangeStart to excludedRangeEnd. Start values are inclusive, end values exclusive.