Java Code Examples for gnu.trove.TIntArrayList#forEach()

The following examples show how to use gnu.trove.TIntArrayList#forEach() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MergeModelBase.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void registerUndoRedo(boolean undo, @javax.annotation.Nullable TIntArrayList affectedChanges) {
  if (myUndoManager == null) return;

  List<S> states;
  if (affectedChanges != null) {
    states = new ArrayList<>(affectedChanges.size());
    affectedChanges.forEach((index) -> {
      states.add(storeChangeState(index));
      return true;
    });
  }
  else {
    states = new ArrayList<>(getChangesCount());
    for (int index = 0; index < getChangesCount(); index++) {
      states.add(storeChangeState(index));
    }
  }
  myUndoManager.undoableActionPerformed(new MyUndoableAction(this, states, undo));
}
 
Example 2
Source File: FileBasedIndexImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
private ProjectIndexableFilesFilter(@Nonnull TIntArrayList set, int modificationCount) {
  myModificationCount = modificationCount;
  final int[] minMax = new int[2];
  if (!set.isEmpty()) {
    minMax[0] = minMax[1] = set.get(0);
  }
  set.forEach(value -> {
    minMax[0] = Math.min(minMax[0], value);
    minMax[1] = Math.max(minMax[1], value);
    return true;
  });
  myMaxId = minMax[1];
  myMinId = minMax[0];
  myBitMask = new long[((myMaxId - myMinId) >> SHIFT) + 1];
  set.forEach(value -> {
    value -= myMinId;
    myBitMask[value >> SHIFT] |= (1L << (value & MASK));
    return true;
  });
}
 
Example 3
Source File: CompressedRefs.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
SmartList<VcsRef> refsToCommit(int index) {
  SmartList<VcsRef> result = new SmartList<>();
  if (myBranches.containsKey(index)) result.addAll(myBranches.get(index));
  TIntArrayList tags = myTags.get(index);
  if (tags != null) {
    tags.forEach(value -> {
      result.add(myHashMap.getVcsRef(value));
      return true;
    });
  }
  return result;
}