All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lwhite1.tablesaw.util.Selection Maven / Gradle / Ivy

There is a newer version: 0.7.7.3
Show newest version
package com.github.lwhite1.tablesaw.util;

import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntIterable;
import org.roaringbitmap.RoaringBitmap;

/**
 * A selection maintains an ordered set of ints that can be used to select rows from a table or column
 */
public interface Selection extends IntIterable {

  int[] toArray();

  /**
   * Returns an IntArrayList containing the ints in this selection
   */
  RoaringBitmap toBitmap();

  IntArrayList toIntArrayList();

  /**
   * Adds the given integer to the Selection if it is not already present, and does nothing otherwise
   */
  void add(int i);

  int size();

  /**
   * Intersects the receiver and {@code otherSelection}, updating the receiver
   */
  void and(Selection otherSelection);

  /**
   * Implements the union of the receiver and {@code otherSelection}, updating the receiver
   */
  void or(Selection otherSelection);

  /**
   * Implements the set difference operation between the receiver and {@code otherSelection}, updating the receiver
   */
  void andNot(Selection otherSelection);

  boolean isEmpty();

  void clear();

  boolean contains(int i);

  /**
   * Adds to the current bitmap all integers in [rangeStart,rangeEnd)
   *
   * @param start inclusive beginning of range
   * @param end exclusive ending of range
   */
  void addRange(int start, int end);

  int get(int i);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy