cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [Heads Up] Utility for efficiency
Date Fri, 18 Jan 2002 09:28:05 GMT
Berin Loritsch wrote:

> The current version of Excalibur that is in Cocoon's CVS has new buffer 
> classes that are very efficient.  Many times we need to temporarily

 > buffer objects as a sort of queue.  When order is important, we have
 > to use a List.  In these applications, we do not need the indexing
 > features of a List, and merely need to add and remove elements to and
 > from the buffer.

> 
> That is the purpose of the Buffer class.  The interface is:
> 
> interface Buffer
> {
>     int size();
>     boolean isEmpty();
> 
>     void add(Object o);
>     Object remove();
> }
> 

<snip/>

Buffers are really great for FIFO (first in, first out).

For LIFO (last in, first out), the JDK offers java.util.Stack, but its 
use should avoided since it is synchronized. There's an unsynchronized 
replacement in org.apache.avalon.excalibur.collections.ArrayStack.


Sylvain

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message