gnu.trove.TIntArrayList.contains()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中gnu.trove.TIntArrayList.contains()方法的一些代码示例,展示了TIntArrayList.contains()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TIntArrayList.contains()方法的具体详情如下:
包路径:gnu.trove.TIntArrayList
类名称:TIntArrayList
方法名:contains

TIntArrayList.contains介绍

[英]See gnu.trove.list.array.TIntArrayList#contains(int)
[中]见gnu。宝藏。列表大堆TIntArrayList#contains(int)

代码示例

代码示例来源:origin: JetBrains/ideavim

private static void addNavigationElements(@NotNull TreeElement root, @NotNull TIntArrayList navigationOffsets, boolean start) {
 if (root instanceof PsiTreeElementBase) {
  PsiElement element = ((PsiTreeElementBase)root).getValue();
  int offset;
  if (start) {
   offset = element.getTextRange().getStartOffset();
   if (element.getLanguage().getID().equals("JAVA")) {
    // HACK: for Java classes and methods, we want to jump to the opening brace
    int textOffset = element.getTextOffset();
    int braceIndex = element.getText().indexOf('{', textOffset - offset);
    if (braceIndex >= 0) {
     offset += braceIndex;
    }
   }
  }
  else {
   offset = element.getTextRange().getEndOffset() - 1;
  }
  if (!navigationOffsets.contains(offset)) {
   navigationOffsets.add(offset);
  }
 }
 for (TreeElement child : root.getChildren()) {
  addNavigationElements(child, navigationOffsets, start);
 }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-common

/**
 * @param _intValue l'indice a tester
 * @return true si contenu
 */
public boolean contains(final int _intValue) {
 return list_.contains(_intValue);
}

代码示例来源:origin: cc.mallet/mallet

public boolean contains(Object o)
{
 return included.contains (universe.getIndex ((Variable) o));
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public boolean contains(Object o)
{
 return included.contains (universe.getIndex ((Variable) o));
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public boolean contains(Object o)
{
 return included.contains (universe.getIndex ((Variable) o));
}

代码示例来源:origin: jatecs/jatecs

public TIntArrayListIterator selectNegatives(String category) {
  short catID = _index.getCategoryDB().getCategory(category);
  TreeSet<Item> best = _best.get(catID);
  assert (best != null);
  TIntArrayList neg = new TIntArrayList();
  Iterator<Item> it = best.iterator();
  while (it.hasNext()) {
    Item docS = it.next();
    assert (!neg.contains(docS.docID));
    neg.add(docS.docID);
  }
  neg.sort();
  return new TIntArrayListIterator(neg);
}

代码示例来源:origin: jatecs/jatecs

String[] fields = line.split(" ");
int value = Integer.parseInt(fields[0]);
if (!values.contains(value))
  values.add(value);

代码示例来源:origin: org.fuzzydb.attrs/org.fuzzydb.attrs.compact

/**
 * Get/allocate spaceNeeded entries for the designated float-based attribute
 */
private int getFloatSpace(int attrId, int spaceNeeded) {
  int sequence = AttrDefinitionMgr.getAttrIndex(attrId); // this should be unique across all attributes
  if (sequence < indicesPlusOne.size()) {
    int indexPlusOne = indicesPlusOne.getQuick(sequence);
    if (indexPlusOne > 0) {
      Assert.state(getLength(attrId) == spaceNeeded, "getLength = " + getLength(attrId) + ", requested = " + spaceNeeded); // dumbo check to ensure not asking for diff size
      return indexPlusOne - 1;
    }
  } else {
    padSpace(indicesPlusOne, sequence);
  }
  
  // okay, it's not been allocated so ...
  int index = nextFloatsIndex;
  nextFloatsIndex += spaceNeeded;
  
  indicesPlusOne.set(sequence, index + 1);
  // Add to list of attrIds for iterator
  Assert.state( attrIds.contains(attrId) == false);
  attrIds.add(attrId);
  setLength(sequence, spaceNeeded);
  syncToStore(); // we sync here as we've modified
  return index;
}

代码示例来源:origin: org.fuzzydb.attrs/org.fuzzydb.attrs.compact

Assert.state( attrIds.contains(attrId) == false );
attrIds.add(attrId);

代码示例来源:origin: jatecs/jatecs

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);
    }
  }
}

代码示例来源:origin: jatecs/jatecs

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);
}

代码示例来源:origin: jatecs/jatecs

while (docsPositive.hasNext()) {
  int documentID = docsPositive.next();
  assert (!docsList.contains(documentID));
  docsList.add(documentID);
    + idx.getDocumentDB().getDocumentsCount());
for (int i = 0; i < idx.getDocumentDB().getDocumentsCount(); i++) {
  if (docsList.contains(i))
    continue;

代码示例来源:origin: jatecs/jatecs

while (docsPositive.hasNext()) {
  int documentID = docsPositive.next();
  assert (!docsList.contains(documentID));
  docsList.add(documentID);
    + idx.getDocumentDB().getDocumentsCount());
for (int i = 0; i < idx.getDocumentDB().getDocumentsCount(); i++) {
  if (docsList.contains(i))
    continue;

代码示例来源:origin: jatecs/jatecs

- numPositivesInValidation;
while (numValidationToReach > 0) {
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  assert (!va.contains(d));
  assert (!tr.contains(d));

代码示例来源:origin: jatecs/jatecs

int numValidationToReach = numValidationDocuments - numPositivesInValidation;
while (numValidationToReach > 0) {
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB().getDocumentsCount());
    continue;
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB().getDocumentsCount());
    continue;
  assert (!va.contains(d));
  assert (!tr.contains(d));

代码示例来源:origin: jatecs/jatecs

- numPositivesInValidation;
while (numValidationToReach > 0) {
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  assert (!va.contains(d));
  assert (!tr.contains(d));

代码示例来源:origin: jatecs/jatecs

- numPositivesInValidation;
while (numValidationToReach > 0) {
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  assert (!va.contains(d));
  assert (!tr.contains(d));

代码示例来源:origin: jatecs/jatecs

- numPositivesInValidation;
while (numValidationToReach > 0) {
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  if (catsPositives.contains(docID)) {
    docID = ((docID + 1) % index.getDocumentDB()
        .getDocumentsCount());
  assert (!va.contains(d));
  assert (!tr.contains(d));

相关文章