Code example for HashSet

Methods: add, size

0
mTimerWakeLock.acquire(timeout);
    } 
 
    public synchronized void acquire(Object holder) {
        mHolders.add(holder);
        if (mWakeLock == null) {
            mWakeLock = mPowerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock");
        } 
        if (!mWakeLock.isHeld()) mWakeLock.acquire();
        Log.v(THIS_FILE, "acquire wakelock: holder count="
                + mHolders.size());
    } 
 
    public synchronized void release(Object holder) {
        mHolders.remove(holder);
        if ((mWakeLock != null) && mHolders.isEmpty()
                && mWakeLock.isHeld()) {
            mWakeLock.release();
        }