本文整理汇总了Java中com.intellij.util.ArrayUtil.EMPTY_INT_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.EMPTY_INT_ARRAY属性的具体用法?Java ArrayUtil.EMPTY_INT_ARRAY怎么用?Java ArrayUtil.EMPTY_INT_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.util.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.EMPTY_INT_ARRAY属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
@NotNull
private static int[] next(int i, Instruction[] myInstructions) {
Instruction instruction = myInstructions[i];
if (instruction instanceof GotoInstruction) {
return new int[]{((GotoInstruction)instruction).getOffset()};
}
if (instruction instanceof ReturnInstruction) {
return ArrayUtil.EMPTY_INT_ARRAY;
}
if (instruction instanceof ConditionalGotoInstruction) {
int offset = ((ConditionalGotoInstruction)instruction).getOffset();
if (offset != i+1) {
return new int[]{i + 1, offset};
}
}
return i == myInstructions.length-1 ? ArrayUtil.EMPTY_INT_ARRAY : new int[]{i + 1};
}
示例2: doHighlighting
@NotNull
protected List<HighlightInfo> doHighlighting() {
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
TIntArrayList toIgnoreList = new TIntArrayList();
if (!doFolding()) {
toIgnoreList.add(Pass.UPDATE_FOLDING);
}
if (!doInspections()) {
toIgnoreList.add(Pass.LOCAL_INSPECTIONS);
toIgnoreList.add(Pass.WHOLE_FILE_LOCAL_INSPECTIONS);
}
int[] toIgnore = toIgnoreList.isEmpty() ? ArrayUtil.EMPTY_INT_ARRAY : toIgnoreList.toNativeArray();
Editor editor = getEditor();
PsiFile file = getFile();
if (editor instanceof EditorWindow) {
editor = ((EditorWindow)editor).getDelegate();
file = InjectedLanguageManager.getInstance(file.getProject()).getTopLevelFile(file);
}
return CodeInsightTestFixtureImpl.instantiateAndRun(file, editor, toIgnore, false);
}
示例3: list
public static int[] list(int id) {
try {
r.lock();
try {
final DataInputStream input = readAttribute(id, ourChildrenAttr);
if (input == null) return ArrayUtil.EMPTY_INT_ARRAY;
final int count = DataInputOutputUtil.readINT(input);
final int[] result = ArrayUtil.newIntArray(count);
int prevId = id;
for (int i = 0; i < count; i++) {
prevId = result[i] = DataInputOutputUtil.readINT(input) + prevId;
}
input.close();
return result;
}
finally {
r.unlock();
}
}
catch (Throwable e) {
throw DbConnection.handleError(e);
}
}
示例4: getSelectedCells
public int[] getSelectedCells(@Nullable final Point dragOrigin) {
ArrayList<Integer> selection = new ArrayList<Integer>();
RadContainer container = getSelectedGridContainer();
if (container == null) {
return ArrayUtil.EMPTY_INT_ARRAY;
}
int size = getCellCount();
for(int i=0; i<size; i++) {
if (mySelectionModel.isSelectedIndex(i)) {
selection.add(i);
}
}
if (selection.size() == 0 && dragOrigin != null) {
int cell = getCellAt(dragOrigin);
if (cell >= 0) {
return new int[] { cell };
}
}
int[] result = new int[selection.size()];
for(int i=0; i<selection.size(); i++) {
result [i] = selection.get(i).intValue();
}
return result;
}
示例5: keys
public int[] keys() {
int[] multiKeys = myMultipleValuesMap != null ? myMultipleValuesMap.keys() : ArrayUtil.EMPTY_INT_ARRAY;
int[] singleKeys = mySingleValueMap.keys();
if (singleKeys.length == 0) return multiKeys;
int[] combinedKeys = new int[multiKeys.length + singleKeys.length];
System.arraycopy(multiKeys, 0, combinedKeys, 0, multiKeys.length);
System.arraycopy(singleKeys, 0, combinedKeys, multiKeys.length, singleKeys.length);
return combinedKeys;
}
示例6: get
@NotNull
public synchronized int[] get(final int id) {
assertPointer(id);
try {
if (id >= pointers.size) {
return ArrayUtil.EMPTY_INT_ARRAY;
}
int arrayBase = pointers.get(id);
IntArray array = arrayBase == 0 ? EMPTY : new IntArray(data, arrayBase);
return array.toArray();
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
示例7: listRoots
static int[] listRoots() {
try {
r.lock();
try {
final DataInputStream input = readAttribute(1, ourChildrenAttr);
if (input == null) return ArrayUtil.EMPTY_INT_ARRAY;
try {
final int count = DataInputOutputUtil.readINT(input);
int[] result = ArrayUtil.newIntArray(count);
int prevId = 0;
for (int i = 0; i < count; i++) {
DataInputOutputUtil.readINT(input); // Name
prevId = result[i] = DataInputOutputUtil.readINT(input) + prevId; // Id
}
return result;
}
finally {
input.close();
}
}
finally {
r.unlock();
}
}
catch (Throwable e) {
throw DbConnection.handleError(e);
}
}
示例8: clearLineModificationFlags
public void clearLineModificationFlags(@NotNull Document document) {
if (document instanceof DocumentWindow) {
document = ((DocumentWindow)document).getDelegate();
}
if (!(document instanceof DocumentImpl)) {
return;
}
Editor activeEditor = getActiveEditor(document);
// when virtual space enabled, we can strip whitespace anywhere
boolean isVirtualSpaceEnabled = activeEditor == null || activeEditor.getSettings().isVirtualSpace();
final EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance();
if (settings == null) return;
boolean enabled = !Boolean.TRUE.equals(DISABLE_FOR_FILE_KEY.get(FileDocumentManager.getInstance().getFile(document)));
if (!enabled) return;
String stripTrailingSpaces = settings.getStripTrailingSpaces();
final boolean doStrip = !stripTrailingSpaces.equals(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE);
final boolean inChangedLinesOnly = !stripTrailingSpaces.equals(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE);
int[] caretLines;
if (activeEditor != null && inChangedLinesOnly && doStrip && !isVirtualSpaceEnabled) {
List<Caret> carets = activeEditor.getCaretModel().getAllCarets();
caretLines = new int[carets.size()];
for (int i = 0; i < carets.size(); i++) {
Caret caret = carets.get(i);
caretLines[i] = caret.getLogicalPosition().line;
}
}
else {
caretLines = ArrayUtil.EMPTY_INT_ARRAY;
}
((DocumentImpl)document).clearLineModificationFlagsExcept(caretLines);
}
示例9: get
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();
}
示例10: getColumnWidths
private int[] getColumnWidths() {
try {
Object viewObject = myViewInfo.getViewObject();
Class<?> viewClass = viewObject.getClass();
Field maxWidths = viewClass.getDeclaredField("mMaxWidths");
maxWidths.setAccessible(true);
int[] columnWidths = (int[])maxWidths.get(viewObject);
return columnWidths == null ? ArrayUtil.EMPTY_INT_ARRAY : columnWidths;
}
catch (Throwable e) {
return ArrayUtil.EMPTY_INT_ARRAY;
}
}
示例11: getFromMultimap
private int[] getFromMultimap(int key) {
TIntArrayList res = myMultipleValuesMap != null ? myMultipleValuesMap.get(key) : null;
if (res == null) return ArrayUtil.EMPTY_INT_ARRAY;
return res.toNativeArray();
}
示例12: toArray
@Override
public int[] toArray() {
return ArrayUtil.EMPTY_INT_ARRAY;
}