本文整理汇总了Java中gnu.trove.TIntArrayList.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java TIntArrayList.isEmpty方法的具体用法?Java TIntArrayList.isEmpty怎么用?Java TIntArrayList.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntArrayList
的用法示例。
在下文中一共展示了TIntArrayList.isEmpty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doHighlighting
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
@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);
}
示例2: calculateWidthIncrease
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
/**
* It's possible that we need to expand quick doc control's width in order to provide better visual representation
* (see https://youtrack.jetbrains.com/issue/IDEA-101425). This method calculates that width expand.
*
* @param buttonWidth icon button's width
* @param updatedText text which will be should at the quick doc control
* @return width increase to apply to the target quick doc control (zero if no additional width increase is required)
*/
private static int calculateWidthIncrease(int buttonWidth, String updatedText) {
int maxLineWidth = 0;
TIntArrayList lineWidths = new TIntArrayList();
for (String lineText : StringUtil.split(updatedText, "<br/>")) {
String html = HintUtil.prepareHintText(lineText, HintUtil.getInformationHint());
int width = new JLabel(html).getPreferredSize().width;
maxLineWidth = Math.max(maxLineWidth, width);
lineWidths.add(width);
}
if (!lineWidths.isEmpty()) {
int firstLineAvailableTrailingWidth = maxLineWidth - lineWidths.get(0);
if (firstLineAvailableTrailingWidth >= buttonWidth) {
return 0;
}
else {
return buttonWidth - firstLineAvailableTrailingWidth;
}
}
return 0;
}
示例3: actionPerformed
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
ArrangementMatchingRulesControl control = getRulesControl(e);
if (control == null) {
return;
}
control.hideEditor();
final TIntArrayList rowsToRemove = control.getSelectedModelRows();
if (rowsToRemove.isEmpty()) {
return;
}
final ArrangementMatchingRulesModel model = control.getModel();
control.runOperationIgnoreSelectionChange(new Runnable() {
@Override
public void run() {
for (int i = 0; i < rowsToRemove.size(); i++) {
int row = rowsToRemove.get(i);
model.removeRow(row);
}
}
});
}
示例4: removeFromMultiMap
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private void removeFromMultiMap(int key, int value) {
final TIntObjectHashMap<TIntArrayList> map = myMultipleValuesMap;
if (map == null) return;
TIntArrayList list = map.get(key);
if (list != null) {
int offset = list.indexOf(value);
if (offset != -1) {
list.remove(offset);
if (list.isEmpty()) {
map.remove(key);
}
}
}
}
示例5: mergeCommentLists
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private static void mergeCommentLists(TIntArrayList commentStarts,
TIntArrayList commentEnds,
TIntArrayList commentStartsList,
TIntArrayList commentEndsList) {
if (commentStarts.isEmpty() && commentEnds.isEmpty()) {
commentStarts.add(commentStartsList.toNativeArray());
commentEnds.add(commentEndsList.toNativeArray());
return;
}
ContainerUtil.mergeSortedArrays(commentStarts, commentEnds, commentStartsList, commentEndsList);
}
示例6: unescapePercentSequences
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
@NotNull
public static String unescapePercentSequences(@NotNull String s) {
if (s.indexOf('%') == -1) {
return s;
}
StringBuilder decoded = new StringBuilder();
final int len = s.length();
int i = 0;
while (i < len) {
char c = s.charAt(i);
if (c == '%') {
TIntArrayList bytes = new TIntArrayList();
while (i + 2 < len && s.charAt(i) == '%') {
final int d1 = decode(s.charAt(i + 1));
final int d2 = decode(s.charAt(i + 2));
if (d1 != -1 && d2 != -1) {
bytes.add(((d1 & 0xf) << 4 | d2 & 0xf));
i += 3;
}
else {
break;
}
}
if (!bytes.isEmpty()) {
final byte[] bytesArray = new byte[bytes.size()];
for (int j = 0; j < bytes.size(); j++) {
bytesArray[j] = (byte)bytes.getQuick(j);
}
decoded.append(new String(bytesArray, CharsetToolkit.UTF8_CHARSET));
continue;
}
}
decoded.append(c);
i++;
}
return decoded.toString();
}
示例7: getInstalledPluginNameByPath
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
@Override
public String getInstalledPluginNameByPath(Project project, @NotNull VirtualFile pluginPath) {
String nameFromPluginXml = super.getInstalledPluginNameByPath(project, pluginPath);
if (nameFromPluginXml != null) {
return nameFromPluginXml;
}
VirtualFile pluginJson = pluginPath.findChild("plugin.json");
if (pluginJson != null) {
String pluginAndVersion = pluginPath.getName(); // pluginName-version
TIntArrayList separatorIndexes = new TIntArrayList();
int start = -1;
while (true) {
start = pluginAndVersion.indexOf('-', start + 1);
if (start == -1) break;
separatorIndexes.add(start);
}
if (separatorIndexes.size() == 1) {
return pluginAndVersion.substring(0, separatorIndexes.get(0));
}
if (!separatorIndexes.isEmpty()) {
String json;
try {
json = VfsUtil.loadText(pluginJson);
}
catch (IOException e) {
return null;
}
for (int i = 0; i < separatorIndexes.size(); i++) {
int idx = separatorIndexes.get(i);
String name = pluginAndVersion.substring(0, idx);
String version = pluginAndVersion.substring(idx + 1);
if (hasValue(PLUGIN_NAME_JSON_PATTERN, json, name) && hasValue(PLUGIN_VERSION_JSON_PATTERN, json, version)) {
return name;
}
}
}
}
return null;
}