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


Java ArrayUtil.remove方法代码示例

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


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

示例1: getReferencesByElement

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
    if (element instanceof RythmRythmImpl) {
        final ASTNode importNode = element.getNode().findChildByType(RythmTypes.RYTHM_IMPORT);
        if (importNode != null) {
            final PsiElement importInstr = importNode.getPsi();
            final String instructionTarget = RythmJavPsiUtil.getInstructionTarget("@import", (XmlProcessingInstruction /*XmlProcessingInstruction*/) element);
            if (instructionTarget != null && instructionTarget.equals(importInstr.getText())) {
                final PsiReference[] references = RythmReferenceContributor.CLASS_REFERENCE_PROVIDER.getReferencesByString(instructionTarget, element, importInstr.getStartOffsetInParent());
                if (instructionTarget.endsWith(".*")) {
                    return ArrayUtil.remove(references, references.length - 1);
                } else {
                    return references;
                }
            }
        }
    }
    return PsiReference.EMPTY_ARRAY;
}
 
开发者ID:scireum-incubator,项目名称:rythm_plugin,代码行数:21,代码来源:ImportReferenceProvider.java

示例2: removeStamp

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void removeStamp(File file, BuildTarget<?> buildTarget) throws IOException {
  TimestampPerTarget[] state = getState(file);
  if (state != null) {
    int targetId = myTargetsState.getBuildTargetId(buildTarget);
    for (int i = 0; i < state.length; i++) {
      TimestampPerTarget timestampPerTarget = state[i];
      if (timestampPerTarget.targetId == targetId) {
        if (state.length == 1) {
          remove(file);
        }
        else {
          TimestampPerTarget[] newState = ArrayUtil.remove(state, i);
          update(file, newState);
          break;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TimestampStorage.java

示例3: remove

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public boolean remove(@NotNull K key, @NotNull V value) {
  Object current = myMap.get(key);
  if (current == null) {
    return false;
  }
  if (current instanceof Object[]) {
    Object[] curArr = (Object[])current;
    Object[] newArr = ArrayUtil.remove(curArr, value, ArrayUtil.OBJECT_ARRAY_FACTORY);
    myMap.put(key, newArr);
    return newArr.length == curArr.length-1;
  }

  if (value.equals(current)) {
    myMap.remove(key);
    return true;
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MostlySingularMultiMap.java

示例4: minus

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
@Override
public KeyFMap minus(@NotNull Key<?> key) {
  int oldSize = size();
  int keyCode = key.hashCode();
  if (!containsKey(keyCode)) {
    return this;
  }
  if (oldSize == ArrayBackedFMap.ARRAY_THRESHOLD + 1) {
    int[] keys = keys();
    Object[] values = getValues();
    int i = ArrayUtil.indexOf(keys, keyCode);
    keys = ArrayUtil.remove(keys, i);
    values = ArrayUtil.remove(values, i);
    return new ArrayBackedFMap(keys, values);
  }
  return new MapBackedFMap(this, keyCode);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MapBackedFMap.java

示例5: minus

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
@Override
public KeyFMap minus(@NotNull Key<?> key) {
  int oldSize = size();
  int keyCode = key.hashCode();
  for (int i = 0; i< oldSize; i++) {
    int oldKey = keys[i];
    if (keyCode == oldKey) {
      if (oldSize == 3) {
        int i1 = (2-i)/2;
        int i2 = 3 - (i+2)/2;
        Key<Object> key1 = Key.getKeyByIndex(keys[i1]);
        Key<Object> key2 = Key.getKeyByIndex(keys[i2]);
        if (key1 == null && key2 == null) return EMPTY_MAP;
        if (key1 == null) return new OneElementFMap<Object>(key2, values[i2]);
        if (key2 == null) return new OneElementFMap<Object>(key1, values[i1]);
        return new PairElementsFMap(key1, values[i1], key2, values[i2]);
      }
      int[] newKeys = ArrayUtil.remove(keys, i);
      Object[] newValues = ArrayUtil.remove(values, i, ArrayUtil.OBJECT_ARRAY_FACTORY);
      return new ArrayBackedFMap(newKeys, newValues);
    }
  }
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ArrayBackedFMap.java

示例6: getReferencesByElement

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
  if (element instanceof XmlProcessingInstruction) {
    final ASTNode importNode = element.getNode().findChildByType(XmlTokenType.XML_TAG_CHARACTERS);
    if (importNode != null) {
      final PsiElement importInstr = importNode.getPsi();
      final String instructionTarget = JavaFxPsiUtil.getInstructionTarget("import", (XmlProcessingInstruction)element);
      if (instructionTarget != null && instructionTarget.equals(importInstr.getText())) {
        final PsiReference[] references =
          FxmlReferencesContributor.CLASS_REFERENCE_PROVIDER.getReferencesByString(instructionTarget, element, importInstr.getStartOffsetInParent());
        if (instructionTarget.endsWith(".*")) {
          return ArrayUtil.remove(references, references.length - 1);
        }
        else {
          return references;
        }
      }
    }
  }
  return PsiReference.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ImportReferenceProvider.java

示例7: removeCoverageSuite

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public void removeCoverageSuite(final CoverageSuite suite) {
  final String fileName = suite.getCoverageDataFileName();

  boolean deleteTraces = suite.isTracingEnabled();
  if (!FileUtil.isAncestor(PathManager.getSystemPath(), fileName, false)) {
    String message = "Would you like to delete file \'" + fileName + "\' ";
    if (deleteTraces) {
      message += "and traces directory \'" + FileUtil.getNameWithoutExtension(new File(fileName)) + "\' ";
    }
    message += "on disk?";
    if (Messages.showYesNoDialog(myProject, message, CommonBundle.getWarningTitle(), Messages.getWarningIcon()) == Messages.YES) {
      deleteCachedCoverage(fileName, deleteTraces);
    }
  } else {
    deleteCachedCoverage(fileName, deleteTraces);
  }

  myCoverageSuites.remove(suite);
  if (myCurrentSuitesBundle != null && myCurrentSuitesBundle.contains(suite)) {
    CoverageSuite[] suites = myCurrentSuitesBundle.getSuites();
    suites = ArrayUtil.remove(suites, suite);
    chooseSuitesBundle(suites.length > 0 ? new CoverageSuitesBundle(suites) : null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:CoverageDataManagerImpl.java

示例8: removeFromMap

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private void removeFromMap(int id, int index) {
  id = unwrap(myFactory.getValue(id)).getID();
  int[] classes = myIdToEqClassesIndices.get(id);
  if (classes != null) {
    int i = ArrayUtil.indexOf(classes, index);
    if (i != -1) {
      classes = ArrayUtil.remove(classes, i);
      myIdToEqClassesIndices.put(id, classes);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DfaMemoryStateImpl.java

示例9: removeFromList

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
public static NamedScope[] removeFromList(@NotNull NamedScope[] scopes) {
  int nonProjectIdx = -1;
  for (int i = 0, length = scopes.length; i < length; i++) {
    NamedScope scope = scopes[i];
    if (scope instanceof NonProjectFilesScope) {
      nonProjectIdx = i;
      break;
    }
  }
  if (nonProjectIdx > -1) {
    scopes = ArrayUtil.remove(scopes, nonProjectIdx);
  }
  return scopes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:NonProjectFilesScope.java

示例10: removeFromOpened

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
@NotNull
private Collection<Project> removeFromOpened(@NotNull Project project) {
  synchronized (lock) {
    myOpenProjects = ArrayUtil.remove(myOpenProjects, project);
    ProjectCoreUtil.theProject = myOpenProjects.length == 1 ? myOpenProjects[0] : null;
    return Arrays.asList(myOpenProjects);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ProjectManagerImpl.java

示例11: rearrangeOrderEntryOfType

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private static int rearrangeOrderEntryOfType(ModifiableRootModel rootModel, Class<? extends OrderEntry> orderEntryClass) {
  OrderEntry[] orderEntries = rootModel.getOrderEntries();
  int moduleSourcesIdx = 0;
  for (OrderEntry orderEntry : orderEntries) {
    if (orderEntryClass.isAssignableFrom(orderEntry.getClass())) {
      break;
    }
    moduleSourcesIdx++;
  }
  orderEntries = ArrayUtil.append(orderEntries, orderEntries[moduleSourcesIdx]);
  orderEntries = ArrayUtil.remove(orderEntries, moduleSourcesIdx);
  rootModel.rearrangeOrderEntries(orderEntries);
  return orderEntries.length - 1;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:EclipseClasspathReader.java

示例12: removeFromArray

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private void removeFromArray(int index) {
  myData.myChildrenIds = ArrayUtil.remove(myData.myChildrenIds, index);
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:VirtualDirectoryImpl.java

示例13: removeParam

import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
public static GrClosureSignature removeParam(final GrClosureSignature signature, int i) {
  final GrClosureParameter[] newParams = ArrayUtil.remove(signature.getParameters(), i);
  return new GrClosureSignatureWithNewParameters(signature, newParams);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GrClosureSignatureUtil.java


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