use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.
the class MatrixClientAdapter method findNewRows.
private RowIndex findNewRows(RowIndex rowIndex) {
IntOpenHashSet need = new IntOpenHashSet();
IntOpenHashSet fetchingRowIds = fetchingRowSets.get(rowIndex.getMatrixId());
IntIterator iter = rowIndex.getRowIds().iterator();
while (iter.hasNext()) {
int rowId = iter.nextInt();
if (!fetchingRowIds.contains(rowId)) {
need.add(rowId);
fetchingRowIds.add(rowId);
}
}
return new RowIndex(rowIndex.getMatrixId(), need, rowIndex);
}
use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.
the class RowIndex method listRowIds.
public String listRowIds() {
int[] idList = new int[rowIdSet.size()];
IntIterator iter = rowIdSet.iterator();
int i = 0;
while (iter.hasNext()) {
idList[i++] = iter.nextInt();
}
Arrays.sort(idList);
StringBuilder sb = new StringBuilder();
for (i = 0; i < idList.length; i++) {
sb.append(idList[i]);
sb.append(",");
}
return sb.toString();
}
use of it.unimi.dsi.fastutil.ints.IntIterator in project angel by Tencent.
the class RowUpdateInfo method getMinClock.
/**
* Get min clock of this row, remove clocks of tasks which would never update this row.
*
* @return min clock value
*/
public int getMinClock() {
if (clocks.size() == 0) {
return 0;
}
IntIterator iter = clocks.values().iterator();
int min = Integer.MAX_VALUE;
while (iter.hasNext()) {
int clock = iter.nextInt();
if (clock < min) {
min = clock;
}
}
return min;
}
use of it.unimi.dsi.fastutil.ints.IntIterator in project symja_android_library by axkr.
the class DateColumn method removeMissing.
@Override
public DateColumn removeMissing() {
DateColumn noMissing = emptyCopy();
IntIterator iterator = intIterator();
while (iterator.hasNext()) {
int i = iterator.nextInt();
if (!valueIsMissing(i)) {
noMissing.appendInternal(i);
}
}
return noMissing;
}
use of it.unimi.dsi.fastutil.ints.IntIterator in project symja_android_library by axkr.
the class DateFilters method eval.
default Selection eval(IntBiPredicate predicate, int value) {
Selection selection = new BitmapBackedSelection();
IntIterator iterator = intIterator();
int idx = 0;
while (iterator.hasNext()) {
int next = iterator.nextInt();
if (predicate.test(next, value)) {
selection.add(idx);
}
idx++;
}
return selection;
}
Aggregations