private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {
public Object removeTrustedMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.matchingNodesKeys.get(key); if (existing == null) return null; this.matchingNodesKeys.put(key, null); return this.matchingNodes.removeKey(node); } public String toString() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {
private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {
private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {
private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removeTrustedMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.matchingNodesKeys.get(key); if (existing == null) return null; this.matchingNodesKeys.put(key, null); return this.matchingNodes.removeKey(node); } public String toString() {
private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {
private void rehash() { HashtableOfLong newHashtable = new HashtableOfLong(this.elementSize * 2); // double the number of expected elements long currentKey; for (int i = this.keyTable.length; --i >= 0;) if ((currentKey = this.keyTable[i]) != 0) newHashtable.put(currentKey, this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } public int size() {
public Object put(long key, Object value) { int length = this.keyTable.length, index = ((int)(key >>> 32)) % length; long currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object removePossibleMatch(ASTNode node) { long key = (((long) node.sourceStart) << 32) + node.sourceEnd; ASTNode existing = (ASTNode) this.possibleMatchingNodesKeys.get(key); if (existing == null) return null; this.possibleMatchingNodesKeys.put(key, null); return this.possibleMatchingNodesSet.remove(node); } public Object removeTrustedMatch(ASTNode node) {