public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } else { keys[index] = REMOVED; numEntries--; return true; } }
public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } else { keys[index] = REMOVED; numEntries--; return true; } }
public boolean contains(long key) { return key != NULL && key != REMOVED && keys[find(key)] != NULL; }
public boolean remove(long key) { if (key == NULL || key == REMOVED) { return false; } int index = find(key); if (keys[index] == NULL) { return false; } else { keys[index] = REMOVED; numEntries--; return true; } }
public boolean contains(long key) { return key != NULL && key != REMOVED && keys[find(key)] != NULL; }
public boolean contains(long key) { return key != NULL && key != REMOVED && keys[find(key)] != NULL; }
/** * Convenience method to quickly compute just the size of the intersection with another {@link FastIDSet}. * * @param other * {@link FastIDSet} to intersect with * @return number of elements in intersection */ public int intersectionSize(FastIDSet other) { int count = 0; for (long key : other.keys) { if (key != NULL && key != REMOVED && keys[find(key)] != NULL) { count++; } } return count; }
/** * Convenience method to quickly compute just the size of the intersection with another {@link FastIDSet}. * * @param other * {@link FastIDSet} to intersect with * @return number of elements in intersection */ public int intersectionSize(FastIDSet other) { int count = 0; for (long key : other.keys) { if (key != NULL && key != REMOVED && keys[find(key)] != NULL) { count++; } } return count; }
/** * Convenience method to quickly compute just the size of the intersection with another {@link FastIDSet}. * * @param other * {@link FastIDSet} to intersect with * @return number of elements in intersection */ public int intersectionSize(FastIDSet other) { int count = 0; for (long key : other.keys) { if (key != NULL && key != REMOVED && keys[find(key)] != NULL) { count++; } } return count; }