Code example for ConcurrentMap

Methods: clear

0
    } 
 
    public void clear() 
    { 
        directBuffers.clear();
        heapBuffers.clear();
    } 
 
    private int bucketFor(int size)
    { 
        int bucket = size / factor;
        if (size % factor > 0)
            ++bucket;
        return bucket;
    } 
 
    private ConcurrentMap<Integer, Queue<ByteBuffer>> buffersFor(boolean direct)
    { 
        return direct ? directBuffers : heapBuffers;
    } 
}