コード例 #1
0
  /** Returns true, if the object is in the set. */
  public boolean contains(T obj) {
    /* check if the object is in the map, direct call of map.getInt will
     * add the object into the map.
     */
    if (!map.contains(obj)) return false;

    int bitNum = map.getInt(obj);

    return (bits[bitNum / 32] & (1 << (bitNum % 32))) != 0;
  }
コード例 #2
0
  public void remove(T obj) {
    int bitNum = map.getInt(obj);

    bits[bitNum / 32] &= ~(1 << (bitNum % 32));
  }
コード例 #3
0
  public void add(T obj) {
    int bitNum = map.getInt(obj);

    bits[bitNum / 32] |= 1 << (bitNum % 32);
  }