/** * Returns the number of buffers that currently are in the pool and whose Class are the same as the specified * factory's. This method is provided for debugging purposes only. * * @param factory the BufferFactory * @return the number of buffers currently in the pool */ public static int getBufferCount(BufferFactory factory) { int count = 0; int nbBuffers = bufferContainers.size(); for(int i=0; i<nbBuffers; i++) { if(factory.matchesBufferClass(bufferContainers.elementAt(i).getBuffer().getClass())) { count ++; } } return count; }
buffer = bufferContainer.getBuffer();