コード例 #1
0
 @Override
 public boolean add(K k) {
   if (k == null) throw new NullPointerException();
   boolean retVal = !bitSet.get(k.getOrdinal());
   if (retVal) {
     bitSet.set(k.getOrdinal());
     size++;
   }
   return retVal;
 }
コード例 #2
0
  @Override
  public boolean remove(Object o) {
    if (o == null) return false;
    K k = (K) o;
    boolean retVal = bitSet.get(k.getOrdinal());
    if (retVal) {
      bitSet.set(k.getOrdinal(), false);
      size--;
    }

    return retVal;
  }
コード例 #3
0
  @Override
  public boolean contains(Object o) {
    K k = (K) o;

    return k != null && bitSet.get(k.getOrdinal());
  }