本文整理匯總了Java中org.eclipse.jdt.internal.compiler.util.HashtableOfObject.put方法的典型用法代碼示例。如果您正苦於以下問題:Java HashtableOfObject.put方法的具體用法?Java HashtableOfObject.put怎麽用?Java HashtableOfObject.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.internal.compiler.util.HashtableOfObject
的用法示例。
在下文中一共展示了HashtableOfObject.put方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: stopQuery
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; //導入方法依賴的package包/類
synchronized void stopQuery() {
if (--this.cacheUserCount < 0) {
// clear cached items
this.cacheUserCount = -1;
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;
}
}
}
}
示例2: getCompilationUnits
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; //導入方法依賴的package包/類
@Override
public CompilationUnit[] getCompilationUnits() {
int fileCount = this.filenames.length;
CompilationUnit[] units = new CompilationUnit[fileCount];
HashtableOfObject knownFileNames = new HashtableOfObject(fileCount);
String defaultEncoding = (String)this.options.get("org.eclipse.jdt.core.encoding");
if(Util.EMPTY_STRING.equals(defaultEncoding)) {
defaultEncoding = null;
}
for(int i = 0; i < fileCount; ++i) {
char[] charName = this.filenames[i].toCharArray();
if(knownFileNames.get(charName) != null) {
throw new IllegalArgumentException(this.bind("unit.more", this.filenames[i]));
}
knownFileNames.put(charName, charName);
File file = new File(this.filenames[i]);
if(!file.exists()) {
throw new IllegalArgumentException(this.bind("unit.missing", this.filenames[i]));
}
String encoding = this.encodings[i];
if(encoding == null) {
encoding = defaultEncoding;
}
String fileName;
try {
fileName = file.getCanonicalPath();
} catch (IOException var10) {
fileName = this.filenames[i];
}
units[i] = new CompilationUnit((char[])null, fileName, encoding, this.destinationPaths[i], false, null);
}
return units;
}
示例3: copyQueryResults
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; //導入方法依賴的package包/類
private void copyQueryResults(HashtableOfObject categoryToWords, int newPosition) {
char[][] categoryNames = categoryToWords.keyTable;
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.putUnsafely(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);
}
}
}
}
}
}
示例4: getCompilationUnits
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; //導入方法依賴的package包/類
public CompilationUnit[] getCompilationUnits() {
int fileCount = this.filenames.length;
CompilationUnit[] units = new CompilationUnit[fileCount];
HashtableOfObject knownFileNames = new HashtableOfObject(fileCount);
String defaultEncoding = (String) this.options.get(CompilerOptions.OPTION_Encoding);
if (Util.EMPTY_STRING.equals(defaultEncoding))
defaultEncoding = null;
for (int i = 0; i < fileCount; i++) {
char[] charName = this.filenames[i].toCharArray();
if (knownFileNames.get(charName) != null)
throw new IllegalArgumentException(this.bind("unit.more", this.filenames[i])); //$NON-NLS-1$
knownFileNames.put(charName, charName);
File file = new File(this.filenames[i]);
if (!file.exists())
throw new IllegalArgumentException(this.bind("unit.missing", this.filenames[i])); //$NON-NLS-1$
String encoding = this.encodings[i];
if (encoding == null)
encoding = defaultEncoding;
String fileName;
try {
fileName = file.getCanonicalPath();
} catch (IOException e) {
// if we got exception during canonicalization, fall back to the name that was specified
fileName = this.filenames[i];
}
units[i] = new CompilationUnit(null, fileName, encoding, this.destinationPaths[i],
shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()));
}
return units;
}