本文整理汇总了Java中it.unimi.dsi.fastutil.ints.IntIterator.nextInt方法的典型用法代码示例。如果您正苦于以下问题:Java IntIterator.nextInt方法的具体用法?Java IntIterator.nextInt怎么用?Java IntIterator.nextInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.ints.IntIterator
的用法示例。
在下文中一共展示了IntIterator.nextInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMinClock
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
/**
* 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;
}
示例2: listRowIds
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
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();
}
示例3: createLocalsChange
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
private DebugLocalsChange createLocalsChange(
Int2ReferenceMap<DebugLocalInfo> ending, Int2ReferenceMap<DebugLocalInfo> starting) {
if (ending.isEmpty() && starting.isEmpty()) {
return null;
}
if (ending.isEmpty() || starting.isEmpty()) {
return new DebugLocalsChange(ending, starting);
}
IntSet unneeded = new IntArraySet(Math.min(ending.size(), starting.size()));
for (Entry<DebugLocalInfo> entry : ending.int2ReferenceEntrySet()) {
if (starting.get(entry.getIntKey()) == entry.getValue()) {
unneeded.add(entry.getIntKey());
}
}
if (unneeded.size() == ending.size() && unneeded.size() == starting.size()) {
return null;
}
IntIterator iterator = unneeded.iterator();
while (iterator.hasNext()) {
int key = iterator.nextInt();
ending.remove(key);
starting.remove(key);
}
return new DebugLocalsChange(ending, starting);
}
示例4: intersectionPE
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
public boolean intersectionPE(CustomHashMap other){
boolean modified = false;
IntIterator itr = this.keySet().iterator();
while(itr.hasNext()){
int key = itr.nextInt();
int keyInv = 0 - key;
if(!other.containsKey(key) && !other.containsKey(keyInv)){
itr.remove();
modified = true;
}
}
for(int otherKey : other.keySet()){
int otherKeyInv = 0-otherKey;
boolean intst = this.containsKey(otherKey); //does this contain otherKey?
boolean intstPrime = this.containsKey(otherKeyInv); //does this contain -(otherkey)?
if(!intst && intstPrime){
this.put(otherKey, other.get(otherKey));
modified = true;
}
}
return modified;
}
示例5: createNewAttribute
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
public Attribute createNewAttribute(HashMap<String, Attribute> attributes,
String attribute, int noMonths) {
Attribute a = attributes.get(attribute);
int ct = 0;
IntSet keys = a.data.keySet();
IntIterator it = keys.iterator();
ArrayList<SpatioTemporalVal> arr = new ArrayList<SpatioTemporalVal>();
while(ct < noMonths) {
if(!it.hasNext()) {
Utilities.er("no. of months is greater than what is present");
}
int month = it.nextInt();
arr.addAll(a.data.get(month));
ct++;
}
Collections.sort(arr);
Attribute na = new Attribute();
na.data.put(0, arr);
na.nodeSet = a.nodeSet;
return na;
}
示例6: getWriteDeltaOffset
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
/**
* Estimates the number of bits required for the succinct delta representation from strictly incremental
* <code>list</code>. For details of the representation (see
* {@link org.pebble.core.encoding.OutputSuccinctStream#writeDelta(it.unimi.dsi.fastutil.ints.IntList, int) writeDelta}).
* @param list to encode. List must be strictly incremental with positives (including zero) values.
* @param valueBitSize fixed number of bits used to represent value in list to be encoded. It can be any value
* between 1bit and 31 bits.
* @return number of representation bits.
*/
public int getWriteDeltaOffset(final IntList list, final int valueBitSize) {
final IntIterator listIterator = list.iterator();
int offset = getWriteDeltaOffset(list.size());
if (listIterator.hasNext()) {
int value;
int deltaValue;
int lastValue = listIterator.nextInt();
offset += writeIntOffset(lastValue, valueBitSize);
while (listIterator.hasNext()) {
value = listIterator.nextInt();
deltaValue = value - lastValue - 1;
offset += getWriteDeltaOffset(deltaValue);
lastValue = value;
}
}
return offset;
}
示例7: findNewRows
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
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);
}
示例8: intersectReferenced
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
void intersectReferenced(final IntSet attributes, final Attribute[] attributeIndex) {
final IntIterator referencedIterator = referenced.iterator();
while (referencedIterator.hasNext()) {
final int ref = referencedIterator.nextInt();
if (attributes.contains(ref)) {
continue;
}
referencedIterator.remove();
attributeIndex[ref].removeDependent(id);
}
}
示例9: intersection
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
public boolean intersection(CustomHashMap other){
boolean modified = false;
IntIterator itr = this.keySet().iterator();
while(itr.hasNext()){
int curInt = itr.nextInt();
if(!other.containsKey(curInt)){
itr.remove();
modified = false;
}
}
return modified;
}
示例10: nonZeroElements
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public int nonZeroElements() {
int res = 0;
IntIterator rowIter = indexesMap().keySet().iterator();
while (rowIter.hasNext()) {
int row = rowIter.nextInt();
res += indexesMap().get(row).size();
}
return res;
}
示例11: getUsers
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
@Nonnull
public int[] getUsers() {
final int size = rows.size();
final int[] keys = new int[size];
final IntIterator itor = rows.keySet().iterator();
for (int i = 0; i < size; i++) {
if (!itor.hasNext()) {
throw new IllegalStateException();
}
int key = itor.nextInt();
keys[i] = key;
}
return keys;
}
示例12: selectIf
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
public TimeColumn selectIf(LocalTimePredicate predicate) {
TimeColumn column = emptyCopy();
IntIterator iterator = intIterator();
while (iterator.hasNext()) {
int next = iterator.nextInt();
if (predicate.test(PackedLocalTime.asLocalTime(next))) {
column.appendInternal(next);
}
}
return column;
}
示例13: isEqualTo
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
/**
* Returns a bitmap flagging the records for which the value in this column is equal to the value in the given
* column
* Columnwise isEqualTo.
*/
public Selection isEqualTo(TimeColumn column) {
Selection results = new BitmapBackedSelection();
int i = 0;
IntIterator intIterator = column.intIterator();
for (int next : data) {
if (next == intIterator.nextInt()) {
results.add(i);
}
i++;
}
return results;
}
示例14: isEqualTo
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
/**
* Returns a bitmap flagging the records for which the value in this column is equal to the value in the given
* column
* Columnwise isEqualTo.
*/
public Selection isEqualTo(DateColumn column) {
Selection results = new BitmapBackedSelection();
int i = 0;
IntIterator intIterator = column.intIterator();
for (int next : data) {
if (next == intIterator.nextInt()) {
results.add(i);
}
i++;
}
return results;
}
示例15: selectIf
import it.unimi.dsi.fastutil.ints.IntIterator; //导入方法依赖的package包/类
public DateColumn selectIf(LocalDatePredicate predicate) {
DateColumn column = emptyCopy();
IntIterator iterator = intIterator();
while (iterator.hasNext()) {
int next = iterator.nextInt();
if (predicate.test(PackedLocalDate.asLocalDate(next))) {
column.appendInternal(next);
}
}
return column;
}