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); } }
/** * @param _intValue l'indice a tester * @return true si contenu */ public boolean contains(final int _intValue) { return list_.contains(_intValue); }
public boolean contains(Object o) { return included.contains (universe.getIndex ((Variable) o)); }
public boolean contains(Object o) { return included.contains (universe.getIndex ((Variable) o)); }
public boolean contains(Object o) { return included.contains (universe.getIndex ((Variable) o)); }
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); }
String[] fields = line.split(" "); int value = Integer.parseInt(fields[0]); if (!values.contains(value)) values.add(value);
/** * 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; }
Assert.state( attrIds.contains(attrId) == false ); attrIds.add(attrId);
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); } } }
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); }
- 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));
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));
- 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));
- 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));
- 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));