public boolean checkedAdd(final int x) {
    final short hb = Util.highbits(x);
    final int i = highLowContainer.getIndex(hb);
    if (i >= 0) {
      Container c = highLowContainer.getContainerAtIndex(i);
      int oldCard = c.getCardinality();
      // we need to keep the newContainer if a switch between containers type
      // occur, in order to get the new cardinality
      Container newCont = c.add(Util.lowbits(x));
      highLowContainer.setContainerAtIndex(i, newCont);
      if (newCont.getCardinality() > oldCard) {
        return true;
      }
    } else {
      final ArrayContainer newac = new ArrayContainer();
      highLowContainer.insertNewKeyValueAt(-i - 1, hb, newac.add(Util.lowbits(x)));
      return true;
    }
    return false;
  }
public boolean checkedAdd ( final int x ) { final short hb = Util . highbits ( x ) ; final int i = highLowContainer . getIndex ( hb ) ; if ( i >= 0 ) { Container c = highLowContainer . getContainerAtIndex ( i ) ; int oldCard = c . getCardinality ( ) ; Container newCont = c . add ( Util . lowbits ( x ) ) ; highLowContainer . setContainerAtIndex ( i , newCont ) ; if ( newCont . getCardinality ( ) > oldCard ) { return true ; } } else { final ArrayContainer newac = new ArrayContainer ( ) ; highLowContainer . insertNewKeyValueAt ( - i - 1 , hb , newac . add ( Util . lowbits ( x ) ) ) ; return true ; } return false ; }
Add the value to the container (set the value to "true"), whether it already appears or not.

@param x integer value
@return true if the added int wasn't already contained in the bitmap. False otherwise.