Code example for HashSet

Methods: clear, isEmpty, remove

0
        mPowerManager = powerManager;
    } 
 
    synchronized void reset() { 
        if (DEBUG) Log.v(TAG, "reset count=" + mHolders.size());
        mHolders.clear();
        release(null); 
    } 
 
    synchronized void acquire(long timeout) {
        if (mTimerWakeLock == null) {
            mTimerWakeLock = mPowerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock.timer");
            mTimerWakeLock.setReferenceCounted(true);
        } 
        mTimerWakeLock.acquire(timeout);
    } 
 
    synchronized void acquire(Object holder) {
        mHolders.add(holder);
        if (mWakeLock == null) {
            mWakeLock = mPowerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock");
        } 
        if (!mWakeLock.isHeld()) mWakeLock.acquire();
        if (DEBUG) Log.v(TAG, "acquire count=" + mHolders.size());
    } 
 
    synchronized void release(Object holder) {
        mHolders.remove(holder);
        if ((mWakeLock != null) && mHolders.isEmpty()
                && mWakeLock.isHeld()) {
            mWakeLock.release();
        } 
        if (DEBUG) Log.v(TAG, "release count=" + mHolders.size());
    }