private void rehash() { HashtableOfObjectToInt newHashtable = new HashtableOfObjectToInt(this.elementSize * 2); // double the number of expected elements Object currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != null) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; }
public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, CompilationResult compilationResult) { MethodDeclaration methodDeclaration = super.convertToMethodDeclaration(c, compilationResult); if (this.sourceEnds != null) { int selectorSourceEnd = this.sourceEnds.removeKey(c); if (selectorSourceEnd != -1) this.sourceEnds.put(methodDeclaration, selectorSourceEnd); } return methodDeclaration; } public ImportReference createAssistImportReference(char[][] tokens, long[] positions, int mod){
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
public int put(Object key, int value) { int length = this.keyTable.length, index = (key.hashCode()& 0x7FFFFFFF) % length; Object currentKey; while ((currentKey = this.keyTable[index]) != null) { if (currentKey.equals(key)) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; }
protected CompilationUnitStructureRequestor(ICompilationUnit unit, CompilationUnitElementInfo unitInfo, Map newElements) { this.unit = unit; this.unitInfo = unitInfo; this.newElements = newElements; this.occurenceCounts = new HashtableOfObjectToInt(); this.localOccurrenceCounts = new HashtableOfObjectToInt(5); } /**
protected void consumeEnumConstantWithClassBody() { super.consumeEnumConstantWithClassBody(); if ((this.currentToken == TokenNameCOMMA || this.currentToken == TokenNameSEMICOLON) && this.astStack[this.astPtr] instanceof FieldDeclaration) { if (this.sourceEnds != null) { this.sourceEnds.put(this.astStack[this.astPtr], this.scanner.currentPosition - 1); } } } protected void consumeEnumHeaderName() {
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
public int put(Object key, int value) { int length = this.keyTable.length, index = (key.hashCode()& 0x7FFFFFFF) % length; Object currentKey; while ((currentKey = this.keyTable[index]) != null) { if (currentKey.equals(key)) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; }
VariablesAndContainersSaveHelper(DataOutputStream out) { super(); this.classpathEntryIds = new HashtableOfObjectToInt(); this.out = out; this.stringIds = new HashtableOfObjectToInt(); }
protected void consumeEnumConstantNoClassBody() { super.consumeEnumConstantNoClassBody(); if ((this.currentToken == TokenNameCOMMA || this.currentToken == TokenNameSEMICOLON) && this.astStack[this.astPtr] instanceof FieldDeclaration) { if (this.sourceEnds != null) { this.sourceEnds.put(this.astStack[this.astPtr], this.scanner.currentPosition - 1); } } } protected void consumeEnumConstantWithClassBody() {
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
@Override public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, CompilationResult compilationResult) { MethodDeclaration methodDeclaration = super.convertToMethodDeclaration(c, compilationResult); if (this.sourceEnds != null) { int selectorSourceEnd = this.sourceEnds.removeKey(c); if (selectorSourceEnd != -1) this.sourceEnds.put(methodDeclaration, selectorSourceEnd); } return methodDeclaration; } @Override
private void rehash() { HashtableOfObjectToInt newHashtable = new HashtableOfObjectToInt(this.elementSize * 2); // double the number of expected elements Object currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != null) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; }