本文整理汇总了Java中gnu.trove.TIntArrayList.indexOf方法的典型用法代码示例。如果您正苦于以下问题:Java TIntArrayList.indexOf方法的具体用法?Java TIntArrayList.indexOf怎么用?Java TIntArrayList.indexOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntArrayList
的用法示例。
在下文中一共展示了TIntArrayList.indexOf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
}
示例2: collectPatternMatches
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private static boolean collectPatternMatches(IndexPattern indexPattern,
CharSequence chars,
int commentStart,
int commentEnd,
PsiFile file,
TextRange range,
Processor<IndexPatternOccurrence> consumer,
TIntArrayList matches
) {
Pattern pattern = indexPattern.getPattern();
if (pattern != null) {
ProgressManager.checkCanceled();
CharSequence input = new CharSequenceSubSequence(chars, commentStart, commentEnd);
Matcher matcher = pattern.matcher(input);
while (true) {
//long time1 = System.currentTimeMillis();
boolean found = matcher.find();
//long time2 = System.currentTimeMillis();
//System.out.println("scanned text of length " + (lexer.getTokenEnd() - lexer.getTokenStart() + " in " + (time2 - time1) + " ms"));
if (!found) break;
int start = matcher.start() + commentStart;
int end = matcher.end() + commentStart;
if (start != end) {
if ((range == null || range.getStartOffset() <= start && end <= range.getEndOffset()) && matches.indexOf(start) == -1) {
matches.add(start);
if (!consumer.process(new IndexPatternOccurrenceImpl(file, start, end, indexPattern))) {
return false;
}
}
}
ProgressManager.checkCanceled();
}
}
return true;
}