当前位置: 首页>>代码示例>>Java>>正文


Java TIntHashSet.toArray方法代码示例

本文整理汇总了Java中gnu.trove.TIntHashSet.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java TIntHashSet.toArray方法的具体用法?Java TIntHashSet.toArray怎么用?Java TIntHashSet.toArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.TIntHashSet的用法示例。


在下文中一共展示了TIntHashSet.toArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: read

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public TIntArrayList read(@NotNull DataInput dataInput) throws IOException {
  TIntHashSet result = new TIntHashSet();

  while (((InputStream)dataInput).available() > 0) {
    int id = DataInputOutputUtil.readINT(dataInput);
    if (REMOVED_MARKER == id) {
      id = DataInputOutputUtil.readINT(dataInput);
      result.remove(id);
    }
    else {
      result.add(id);
    }
  }

  return new TIntArrayList(result.toArray());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TestDiscoveryIndex.java

示例2: saveTo

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Override
public void saveTo(DataOutput out, DataExternalizer<Value> externalizer) throws IOException {
  if (needsCompacting()) {
    getMergedData().saveTo(out, externalizer);
  } else {
    final TIntHashSet set = myInvalidated;
    if (set != null && set.size() > 0) {
      for (int inputId : set.toArray()) {
        DataInputOutputUtil.writeINT(out, -inputId); // mark inputId as invalid, to be processed on load in ValueContainerImpl.readFrom
      }
    }

    final ValueContainer<Value> toAppend = getAddedDelta();
    if (toAppend != null && toAppend.size() > 0) {
      toAppend.saveTo(out, externalizer);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ChangeTrackingValueContainer.java

示例3: FilteredIntIterator

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public FilteredIntIterator(IIntIterator it, TIntHashSet list, boolean listDefinesRemoved) {
    _values = it;
    int[] filterValues = list.toArray();
    Arrays.sort(filterValues);
    _filter = new IntArrayIterator(filterValues);
    _remove = listDefinesRemoved;
    begin();
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:9,代码来源:FilteredIntIterator.java

示例4: getFragmentStartingLines

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public int[] getFragmentStartingLines() {
  TIntHashSet beginnings = new TIntHashSet();
  if (myMergeList != null) {
    for (int i = 0; i < 2; i++) {
      FragmentSide branchSide = FragmentSide.fromIndex(i);
      beginnings.addAll(myMergeList.getChanges(branchSide).getNonAppliedLineBlocks().getBeginnings(MergeList.BASE_SIDE));
    }
  }
  int[] result = beginnings.toArray();
  Arrays.sort(result);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MergePanel2.java

示例5: findAllTypedVarOffsets

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@NotNull
private static int[] findAllTypedVarOffsets(final PsiFile file, final Pattern[] substitutionPatterns) {
  final TIntHashSet result = new TIntHashSet();

  file.accept(new PsiRecursiveElementWalkingVisitor() {
    @Override
    public void visitElement(PsiElement element) {
      super.visitElement(element);

      if (element instanceof LeafElement) {
        final String text = element.getText();

        for (Pattern pattern : substitutionPatterns) {
          final Matcher matcher = pattern.matcher(text);

          while (matcher.find()) {
            result.add(element.getTextRange().getStartOffset() + matcher.end());
          }
        }
      }
    }
  });

  final int[] resultArray = result.toArray();
  Arrays.sort(resultArray);
  return resultArray;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:PatternCompiler.java

示例6: get

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
public int[] get(int key) {
  if (mySingle.containsKey(key)) {
    return new int[]{mySingle.get(key)};
  }
  TIntHashSet items = myMulti.get(key);
  if (items == null) return ArrayUtil.EMPTY_INT_ARRAY;
  return items.toArray();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:IntToIntSetMap.java

示例7: findParametersToRemove

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@NotNull
public static TIntArrayList findParametersToRemove(@NotNull PsiMethod method,
                                                   @NotNull final PsiExpression expr,
                                                   @Nullable final PsiExpression[] occurences) {
  final PsiParameter[] parameters = method.getParameterList().getParameters();
  if (parameters.length == 0) return new TIntArrayList();

  PsiMethod[] overridingMethods = OverridingMethodsSearch.search(method, true).toArray(PsiMethod.EMPTY_ARRAY);
  final PsiMethod[] allMethods = ArrayUtil.append(overridingMethods, method);

  final TIntHashSet suspects = new TIntHashSet();
  expr.accept(new JavaRecursiveElementWalkingVisitor() {
    @Override public void visitReferenceExpression(final PsiReferenceExpression expression) {
      super.visitReferenceExpression(expression);
      PsiElement resolved = expression.resolve();
      if (resolved instanceof PsiParameter) {
        int i = ArrayUtil.find(parameters, resolved);
        if (i != -1) {
          suspects.add(i);
        }
      }
    }
  });

  final TIntIterator iterator = suspects.iterator();
  while(iterator.hasNext()) {
    final int paramNum = iterator.next();
    for (PsiMethod psiMethod : allMethods) {
      PsiParameter[] psiParameters = psiMethod.getParameterList().getParameters();
      if (paramNum >= psiParameters.length) continue;
      PsiParameter parameter = psiParameters[paramNum];
      if (!ReferencesSearch.search(parameter, parameter.getResolveScope(), false).forEach(new Processor<PsiReference>() {
        public boolean process(final PsiReference reference) {
          PsiElement element = reference.getElement();
          boolean stillCanBeRemoved = false;
          if (element != null) {
            stillCanBeRemoved = isAncestor(expr, element, false) || PsiUtil.isInsideJavadocComment(getPhysical(element));
            if (!stillCanBeRemoved && occurences != null) {
              for (PsiExpression occurence : occurences) {
                if (isAncestor(occurence, element, false)) {
                  stillCanBeRemoved = true;
                  break;
                }
              }
            }
          }
          if (!stillCanBeRemoved) {
            iterator.remove();
            return false;
          }
         return true;
        }
      })) break;
    }
  }

  return new TIntArrayList(suspects.toArray());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:59,代码来源:Util.java

示例8: getDefinitions

import gnu.trove.TIntHashSet; //导入方法依赖的package包/类
@Nullable
public int[] getDefinitions(int varId) {
  TIntHashSet set = myMap.get(varId);
  return set == null ? null : set.toArray();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:DefinitionMap.java


注:本文中的gnu.trove.TIntHashSet.toArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。