本文整理汇总了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;
}
示例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;
}
}
}
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例12: removeFromArray
import com.intellij.util.ArrayUtil; //导入方法依赖的package包/类
private void removeFromArray(int index) {
myData.myChildrenIds = ArrayUtil.remove(myData.myChildrenIds, index);
((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
}
示例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);
}