Examples of HashtableOfObject


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

    this.cachedChunks = null;
    if (this.categoryTables != null) {
      if (this.cachedCategoryName == null) {
        this.categoryTables = null;
      } else if (this.categoryTables.elementSize > 1) {
        HashtableOfObject newTables = new HashtableOfObject(3);
        newTables.put(this.cachedCategoryName, this.categoryTables.get(this.cachedCategoryName));
        this.categoryTables = newTables;
      }
    }
  }
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

    } finally {
      monitor.exitWriteEnterRead();
    }
  }

  HashtableOfObject results;
  int rule = matchRule & MATCH_RULE_INDEX_MASK;
  if (this.memoryIndex.hasChanged()) {
    results = this.diskIndex.addQueryResults(categories, key, rule, this.memoryIndex);
    results = this.memoryIndex.addQueryResults(categories, key, rule, results);
  } else {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

      if (referenceTables[i] != null && ((String) paths[i]).startsWith(substring, 0))
        results.add(paths[i]);
  }
}
void addIndexEntry(char[] category, char[] key, String documentName) {
  HashtableOfObject referenceTable;
  if (documentName.equals(this.lastDocumentName))
    referenceTable = this.lastReferenceTable;
  else {
    // assumed a document was removed before its reindexed
    referenceTable = (HashtableOfObject) this.docsToReferences.get(documentName);
    if (referenceTable == null)
      this.docsToReferences.put(documentName, referenceTable = new HashtableOfObject(3));
    this.lastDocumentName = documentName;
    this.lastReferenceTable = referenceTable;
  }

  SimpleWordSet existingWords = (SimpleWordSet) referenceTable.get(category);
  if (existingWords == null)
    referenceTable.put(category, existingWords = new SimpleWordSet(1));

  existingWords.add(this.allWords.add(key));
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

  // results maps a word -> EntryResult
  Object[] paths = this.docsToReferences.keyTable;
  Object[] referenceTables = this.docsToReferences.valueTable;
  if (matchRule == (SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE) && key != null) {
    nextPath : for (int i = 0, l = referenceTables.length; i < l; i++) {
      HashtableOfObject categoryToWords = (HashtableOfObject) referenceTables[i];
      if (categoryToWords != null) {
        for (int j = 0, m = categories.length; j < m; j++) {
          SimpleWordSet wordSet = (SimpleWordSet) categoryToWords.get(categories[j]);
          if (wordSet != null && wordSet.includes(key)) {
            if (results == null)
              results = new HashtableOfObject(13);
            EntryResult result = (EntryResult) results.get(key);
            if (result == null)
              results.put(key, result = new EntryResult(key, null));
            result.addDocumentName((String) paths[i]);
            continue nextPath;
          }
        }
      }
    }
  } else {
    for (int i = 0, l = referenceTables.length; i < l; i++) {
      HashtableOfObject categoryToWords = (HashtableOfObject) referenceTables[i];
      if (categoryToWords != null) {
        for (int j = 0, m = categories.length; j < m; j++) {
          SimpleWordSet wordSet = (SimpleWordSet) categoryToWords.get(categories[j]);
          if (wordSet != null) {
            char[][] words = wordSet.words;
            for (int k = 0, n = words.length; k < n; k++) {
              char[] word = words[k];
              if (word != null && Index.isMatch(key, word, matchRule)) {
                if (results == null)
                  results = new HashtableOfObject(13);
                EntryResult result = (EntryResult) results.get(word);
                if (result == null)
                  results.put(word, result = new EntryResult(word, null));
                result.addDocumentName((String) paths[i]);
              }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

  return results;
}
private HashtableOfObject addQueryResult(HashtableOfObject results, char[] word, HashtableOfObject wordsToDocNumbers, MemoryIndex memoryIndex) throws IOException {
  // must skip over documents which have been added/changed/deleted in the memory index
  if (results == null)
    results = new HashtableOfObject(13);
  EntryResult result = (EntryResult) results.get(word);
  if (memoryIndex == null) {
    if (result == null)
      results.put(word, new EntryResult(word, wordsToDocNumbers));
    else
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

}
HashtableOfObject addQueryResults(char[][] categories, char[] key, int matchRule, MemoryIndex memoryIndex) throws IOException {
  // assumes sender has called startQuery() & will call stopQuery() when finished
  if (this.categoryOffsets == null) return null; // file is empty

  HashtableOfObject results = null; // initialized if needed
  if (key == null) {
    for (int i = 0, l = categories.length; i < l; i++) {
      HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], true); // cache if key is null since its a definite match
      if (wordsToDocNumbers != null) {
        char[][] words = wordsToDocNumbers.keyTable;
        if (results == null)
          results = new HashtableOfObject(wordsToDocNumbers.elementSize);
        for (int j = 0, m = words.length; j < m; j++)
          if (words[j] != null)
            results = addQueryResult(results, words[j], wordsToDocNumbers, memoryIndex);
      }
    }
    if (results != null && this.cachedChunks == null)
      cacheDocumentNames();
  } else {
    switch (matchRule) {
      case SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE:
        for (int i = 0, l = categories.length; i < l; i++) {
          HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false);
          if (wordsToDocNumbers != null && wordsToDocNumbers.containsKey(key))
            results = addQueryResult(results, key, wordsToDocNumbers, memoryIndex);
        }
        break;
      case SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE:
        for (int i = 0, l = categories.length; i < l; i++) {
          HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false);
          if (wordsToDocNumbers != null) {
            char[][] words = wordsToDocNumbers.keyTable;
            for (int j = 0, m = words.length; j < m; j++) {
              char[] word = words[j];
              if (word != null && key[0] == word[0] && CharOperation.prefixEquals(key, word))
                results = addQueryResult(results, word, wordsToDocNumbers, memoryIndex);
            }
          }
        }
        break;
      default:
        for (int i = 0, l = categories.length; i < l; i++) {
          HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false);
          if (wordsToDocNumbers != null) {
            char[][] words = wordsToDocNumbers.keyTable;
            for (int j = 0, m = words.length; j < m; j++) {
              char[] word = words[j];
              if (word != null && Index.isMatch(key, word, matchRule))
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

  Object[] wordSets = categoryToWords.valueTable;
  for (int i = 0, l = categoryNames.length; i < l; i++) {
    char[] categoryName = categoryNames[i];
    if (categoryName != null) {
      SimpleWordSet wordSet = (SimpleWordSet) wordSets[i];
      HashtableOfObject wordsToDocs = (HashtableOfObject) this.categoryTables.get(categoryName);
      if (wordsToDocs == null)
        this.categoryTables.put(categoryName, wordsToDocs = new HashtableOfObject(wordSet.elementSize));

      char[][] words = wordSet.words;
      for (int j = 0, m = words.length; j < m; j++) {
        char[] word = words[j];
        if (word != null) {
          Object o = wordsToDocs.get(word);
          if (o == null) {
            wordsToDocs.put(word, new int[] {newPosition});
          } else if (o instanceof IntList) {
            ((IntList) o).add(newPosition);
          } else {
            IntList list = new IntList((int[]) o);
            list.add(newPosition);
            wordsToDocs.put(word, list);
          }
        }
      }
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

  }

  int size = diskIndex.categoryOffsets == null ? 8 : diskIndex.categoryOffsets.elementSize;
  this.categoryOffsets = new HashtableOfIntValues(size);
  this.categoryEnds = new HashtableOfIntValues(size);
  this.categoryTables = new HashtableOfObject(size);
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

    if (categoryNames[i] != null)
      mergeCategory(categoryNames[i], onDisk, positions, stream);
  this.categoryTables = null;
}
private void mergeCategory(char[] categoryName, DiskIndex onDisk, int[] positions, FileOutputStream stream) throws IOException {
  HashtableOfObject wordsToDocs = (HashtableOfObject) this.categoryTables.get(categoryName);
  if (wordsToDocs == null)
    wordsToDocs = new HashtableOfObject(3);

  HashtableOfObject oldWordsToDocs = onDisk.readCategoryTable(categoryName, true);
  if (oldWordsToDocs != null) {
    char[][] oldWords = oldWordsToDocs.keyTable;
    Object[] oldArrayOffsets = oldWordsToDocs.valueTable;
    nextWord: for (int i = 0, l = oldWords.length; i < l; i++) {
      char[] oldWord = oldWords[i];
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject

    TypeVariableBinding var = someType.typeVariables[i];
    // must verify bounds if the variable has more than 1
    if (var.superInterfaces == Binding.NO_SUPERINTERFACES) continue;
    if (var.superInterfaces.length == 1 && var.superclass.id == TypeIds.T_JavaLangObject) continue;

    this.currentMethods = new HashtableOfObject(0);
    ReferenceBinding superclass = var.superclass();
    if (superclass.kind() == Binding.TYPE_PARAMETER)
      superclass = (ReferenceBinding) superclass.erasure();
    ReferenceBinding[] itsInterfaces = var.superInterfaces();
    ReferenceBinding[] superInterfaces = new ReferenceBinding[itsInterfaces.length];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.