BitmapBackedSelection
public interface Selection
extends it.unimi.dsi.fastutil.ints.IntIterable
Modifier and Type | Method | Description |
---|---|---|
Selection |
add(int... ints) |
Adds the given integers to the Selection if it is not already present, and does nothing
otherwise
|
Selection |
addRange(int start,
int end) |
Adds to the current bitmap all integers in [rangeStart,rangeEnd)
|
Selection |
and(Selection otherSelection) |
Returns this Selection object after its data has been intersected with
otherSelection |
Selection |
andNot(Selection otherSelection) |
Implements the set difference operation between the receiver and
otherSelection , after
updating the receiver |
Selection |
clear() |
Returns this selection with all its values cleared
|
boolean |
contains(int i) |
Returns true if the index i is selected in this object
|
Selection |
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 |
isEmpty() |
Returns true if this selection has no values, and false otherwise
|
Selection |
or(Selection otherSelection) |
Returns this Selection object with its data replaced by the union of its starting data and
otherSelection |
Selection |
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 |
size() |
Returns the number of integers represented by this Selection
|
int[] |
toArray() |
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),
|
spliterator
int[] toArray()
Selection add(int... ints)
Selection addRange(int start, int end)
start
- inclusive beginning of rangeend
- exclusive ending of rangeSelection removeRange(long start, long end)
start
- inclusive beginning of rangeend
- exclusive ending of rangeint size()
Selection and(Selection otherSelection)
otherSelection
Selection or(Selection otherSelection)
otherSelection
Selection andNot(Selection otherSelection)
otherSelection
, after
updating the receiverboolean isEmpty()
Selection clear()
boolean contains(int i)
int get(int i)
It can be useful if you need to iterate over the data, although there is also an iterator
Selection flip(int rangeStart, int rangeEnd)
static Selection selectNRowsAtRandom(int n, int max)
static Selection with(int... rows)
static Selection withRange(int start, int end)
static Selection withoutRange(int totalRangeStart, int totalRangeEnd, int excludedRangeStart, int excludedRangeEnd)
Copyright © 2022. All rights reserved.