Constructor | Description |
---|---|
BitmapBackedSelection() |
Constructs an empty Selection
|
BitmapBackedSelection(int size) |
Returns a selection initialized from 0 to the given size, which cane be used for queries that
exclude certain items, by first selecting the items to exclude, then flipping the bits.
|
BitmapBackedSelection(int[] arr) |
Constructs a selection containing the elements in the given array
|
BitmapBackedSelection(org.roaringbitmap.RoaringBitmap bitmap) |
Constructs a selection containing the elements in the given bitmap
|
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) |
Intersects the receiver and
otherSelection , updating the receiver |
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
|
boolean |
equals(Object o) |
|
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.
|
int |
hashCode() |
|
boolean |
isEmpty() |
Returns true if this selection has no values, and false otherwise
|
it.unimi.dsi.fastutil.ints.IntIterator |
iterator() |
Returns a fastUtil intIterator that wraps a bitmap intIterator
|
Selection |
or(Selection otherSelection) |
Implements the union of the receiver and
otherSelection , updating the receiver |
Selection |
removeRange(long start,
long end) |
Removes from the current bitmap from all integers in [rangeStart,rangeEnd)
|
protected 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
|
String |
toString() |
|
protected static Selection |
with(int... rows) |
Returns a Selection containing all indexes in the array
|
protected 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.
|
protected static Selection |
withRange(int start,
int end) |
Returns a Selection containing all indexes in the range start (inclusive) to end (exclusive),
|
spliterator
public BitmapBackedSelection(int size)
size
- The size The end point, exclusivepublic BitmapBackedSelection(int[] arr)
public BitmapBackedSelection(org.roaringbitmap.RoaringBitmap bitmap)
public BitmapBackedSelection()
public Selection removeRange(long start, long end)
removeRange
in interface Selection
start
- inclusive beginning of rangeend
- exclusive ending of rangepublic Selection flip(int rangeStart, int rangeEnd)
public Selection add(int... ints)
public int size()
public int[] toArray()
public Selection and(Selection otherSelection)
otherSelection
, updating the receiverpublic Selection or(Selection otherSelection)
otherSelection
, updating the receiverpublic Selection andNot(Selection otherSelection)
otherSelection
, after
updating the receiverpublic boolean isEmpty()
public Selection clear()
public boolean contains(int i)
public Selection addRange(int start, int end)
public int get(int i)
It can be useful if you need to iterate over the data, although there is also an iterator
public it.unimi.dsi.fastutil.ints.IntIterator iterator()
protected static Selection with(int... rows)
protected static Selection withRange(int start, int end)
protected static Selection withoutRange(int totalRangeStart, int totalRangeEnd, int excludedRangeStart, int excludedRangeEnd)
protected static Selection selectNRowsAtRandom(int n, int max)
Copyright © 2022. All rights reserved.