public synchronized void addRow(Object obj) { if (!enabled || bufferSize<=0) return; // remove the oldest element if the buffer is to capacity. if (getRowCount()>=bufferSize && bufferHolder.shouldReplaceWith(obj)) { bufferHolder.remove(obj); } if (getRowCount()<bufferSize) { bufferHolder.add(obj); } }