Ejemplo n.º 1
0
 /**
  * Returns a hash code for this set.
  *
  * @return a hash code for this set
  */
 @SuppressWarnings("unchecked")
 public int hashCode() {
   long h = 0;
   int i = 0, j = size;
   while (j-- != 0) {
     Object k;
     while ((k = _getKey(i)) == NULL || k == DEL) i++;
     if (this != k) h += strategy.hash((Key) k);
     i++;
   }
   return (int) h;
 }
Ejemplo n.º 2
0
 /**
  * Returns a hash code for this set.
  *
  * @return a hash code for this set
  */
 @SuppressWarnings("unchecked")
 public int hashCode() {
   long h = 0;
   int i = 0, j = size;
   while (j-- != 0) {
     int idx;
     while ((idx = idxs[i]) <= 0) i++;
     Object k = keys[(idx - 1)];
     if (this != k) h += strategy.hash((Key) k);
     i++;
   }
   return (int) h;
 }