/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(double key) { final double tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, else returns -1. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) // assertion: there is at least one FREE slot. while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(double key) { final double tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, else returns -1. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) // assertion: there is at least one FREE slot. while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(double key) { final double tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 if the key was not found. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html //int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; //hashCollisions++; if (i<0) i+=length; } if (stat[i] == FREE) return -1; // not found return i; //found, return index where key is contained } /**
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, else * returns -1. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) // assertion: there is at least one FREE slot. while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(int key) { final int tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, else * returns -1. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // float hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) // assertion: there is at least one FREE slot. while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(double key) { final double tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }
/** * @param key * the key to be searched in the receiver. * @return the index where the key is contained in the receiver, returns -1 * if the key was not found. */ protected int indexOfKey(long key) { final long tab[] = table; final byte stat[] = state; final int length = tab.length; final int hash = HashFunctions.hash(key) & 0x7FFFFFFF; int i = hash % length; int decrement = hash % (length - 2); // double hashing, see // http://www.eece.unm.edu/faculty/heileman/hash/node4.html // int decrement = (hash / length) % length; if (decrement == 0) decrement = 1; // stop if we find a free slot, or if we find the key itself. // do skip over removed slots (yes, open addressing is like that...) while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) { i -= decrement; // hashCollisions++; if (i < 0) i += length; } if (stat[i] == FREE) return -1; // not found return i; // found, return index where key is contained }