本文整理汇总了Java中gnu.trove.TIntArrayList.contains方法的典型用法代码示例。如果您正苦于以下问题:Java TIntArrayList.contains方法的具体用法?Java TIntArrayList.contains怎么用?Java TIntArrayList.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.TIntArrayList
的用法示例。
在下文中一共展示了TIntArrayList.contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectNegativesFromParent
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
protected void selectNegativesFromParent(short cat,
TIntArrayList negatives, short catToCompare) {
IShortIterator cats = _globalIndex.getCategoryDB()
.getSiblingCategories(cat);
while (cats.hasNext()) {
short catID = cats.next();
IIntIterator docsNegative = _globalIndex.getClassificationDB()
.getCategoryDocuments(catID);
while (docsNegative.hasNext()) {
int docID = docsNegative.next();
if (!negatives.contains(docID)
&& !_globalIndex.getClassificationDB()
.hasDocumentCategory(docID, catToCompare))
negatives.add(docID);
}
}
}
示例2: selectNegatives
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public TIntArrayListIterator selectNegatives(String category) {
TIntArrayList negatives = new TIntArrayList();
short id = _globalIndex.getCategoryDB().getCategory(category);
IShortIterator cats = _globalIndex.getCategoryDB()
.getSiblingCategories(id);
while (cats.hasNext()) {
short catID = cats.next();
IIntIterator docsNegative = _globalIndex.getClassificationDB()
.getCategoryDocuments(catID);
while (docsNegative.hasNext()) {
int docID = docsNegative.next();
if (!negatives.contains(docID)
&& !_globalIndex.getClassificationDB()
.hasDocumentCategory(docID, id))
negatives.add(docID);
}
}
return new TIntArrayListIterator(negatives);
}
示例3: getParents
import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
@NotNull
public static TIntArrayList getParents(int id, @NotNull ConcurrentIntObjectMap<?> idCache) {
TIntArrayList result = new TIntArrayList(10);
r.lock();
try {
int parentId;
do {
result.add(id);
if (idCache.containsKey(id)) {
break;
}
parentId = getRecordInt(id, PARENT_OFFSET);
if (parentId == id || result.size() % 128 == 0 && result.contains(parentId)) {
LOG.error("Cyclic parent child relations in the database. id = " + parentId);
return result;
}
id = parentId;
} while (parentId != 0);
}
catch (Throwable e) {
throw DbConnection.handleError(e);
}
finally {
r.unlock();
}
return result;
}