1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.5.0_07) on Fri Apr 11 15:39:16 BST 2008 -->
6 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
8 BufferUtils (Commons Collections
3.2.1 API)
11 <META NAME=
"keywords" CONTENT=
"org.apache.commons.collections.BufferUtils class">
13 <LINK REL =
"stylesheet" TYPE=
"text/css" HREF=
"../../../../stylesheet.css" TITLE=
"Style">
15 <SCRIPT type=
"text/javascript">
16 function windowTitle()
18 parent.document.
title=
"BufferUtils (Commons Collections 3.2.1 API)";
26 <BODY BGCOLOR=
"white" onload=
"windowTitle();">
29 <!-- ========= START OF TOP NAVBAR ======= -->
30 <A NAME=
"navbar_top"><!-- --></A>
31 <A HREF=
"#skip-navbar_top" title=
"Skip navigation links"></A>
32 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
34 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
35 <A NAME=
"navbar_top_firstrow"><!-- --></A>
36 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
37 <TR ALIGN=
"center" VALIGN=
"top">
38 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
39 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
40 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
41 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/BufferUtils.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
42 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
43 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
44 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
45 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
49 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
55 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
56 <A HREF=
"../../../../org/apache/commons/collections/BufferUnderflowException.html" title=
"class in org.apache.commons.collections"><B>PREV CLASS
</B></A>
57 <A HREF=
"../../../../org/apache/commons/collections/Closure.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
58 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
59 <A HREF=
"../../../../index.html?org/apache/commons/collections/BufferUtils.html" target=
"_top"><B>FRAMES
</B></A>
60 <A HREF=
"BufferUtils.html" target=
"_top"><B>NO FRAMES
</B></A>
61 <SCRIPT type=
"text/javascript">
64 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
69 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
76 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
77 SUMMARY:
NESTED
|
<A HREF=
"#field_summary">FIELD
</A> |
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
78 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
79 DETAIL:
<A HREF=
"#field_detail">FIELD
</A> |
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
82 <A NAME=
"skip-navbar_top"></A>
83 <!-- ========= END OF TOP NAVBAR ========= -->
86 <!-- ======== START OF CLASS DATA ======== -->
89 org.apache.commons.collections
</FONT>
91 Class BufferUtils
</H2>
94 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by "><B>org.apache.commons.collections.BufferUtils
</B>
98 <DT><PRE>public class
<B>BufferUtils
</B><DT>extends java.lang.Object
</DL>
102 Provides utility methods and decorators for
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections"><CODE>Buffer
</CODE></A> instances.
107 <DT><B>Since:
</B></DT>
108 <DD>Commons Collections
2.1</DD>
109 <DT><B>Version:
</B></DT>
110 <DD>$Revision:
646777 $ $Date:
2008-
04-
10 13:
33:
15 +
0100 (Thu,
10 Apr
2008) $
</DD>
111 <DT><B>Author:
</B></DT>
112 <DD>Paul Jack, Stephen Colebourne
</DD>
117 <!-- =========== FIELD SUMMARY =========== -->
119 <A NAME=
"field_summary"><!-- --></A>
120 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
121 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
122 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
123 <B>Field Summary
</B></FONT></TH>
125 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
126 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
127 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
128 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#EMPTY_BUFFER">EMPTY_BUFFER
</A></B></CODE>
131 An empty unmodifiable buffer.
</TD>
135 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
137 <A NAME=
"constructor_summary"><!-- --></A>
138 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
139 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
140 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
141 <B>Constructor Summary
</B></FONT></TH>
143 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
144 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#BufferUtils()">BufferUtils
</A></B>()
</CODE>
147 <code>BufferUtils
</code> should not normally be instantiated.
</TD>
151 <!-- ========== METHOD SUMMARY =========== -->
153 <A NAME=
"method_summary"><!-- --></A>
154 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
155 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
156 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
157 <B>Method Summary
</B></FONT></TH>
159 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
160 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
161 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
162 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#blockingBuffer(org.apache.commons.collections.Buffer)">blockingBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</CODE>
165 Returns a synchronized buffer backed by the given buffer that will
166 block on
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations.
</TD>
168 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
169 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
170 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
171 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#blockingBuffer(org.apache.commons.collections.Buffer, long)">blockingBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
172 long
timeoutMillis)
</CODE>
175 Returns a synchronized buffer backed by the given buffer that will
176 block on
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations
177 until
<code>timeout
</code> expires.
</TD>
179 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
180 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
181 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
182 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#boundedBuffer(org.apache.commons.collections.Buffer, int)">boundedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
183 int
maximumSize)
</CODE>
186 Returns a synchronized buffer backed by the given buffer that will
187 block on
<CODE>Collection.add(Object)
</CODE> and
188 <CODE>Collection.addAll(java.util.Collection)
</CODE> until enough object(s) are
189 removed from the buffer to allow the object(s) to be added and still
190 maintain the maximum size.
</TD>
192 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
193 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
194 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
195 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#boundedBuffer(org.apache.commons.collections.Buffer, int, long)">boundedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
196 int
maximumSize,
197 long
timeoutMillis)
</CODE>
200 Returns a synchronized buffer backed by the given buffer that will
201 block on
<CODE>Collection.add(Object)
</CODE> and
202 <CODE>Collection.addAll(java.util.Collection)
</CODE> until enough object(s) are
203 removed from the buffer to allow the object(s) to be added and still
204 maintain the maximum size or the timeout expires.
</TD>
206 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
207 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
208 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
209 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#predicatedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Predicate)">predicatedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
210 <A HREF=
"../../../../org/apache/commons/collections/Predicate.html" title=
"interface in org.apache.commons.collections">Predicate
</A> predicate)
</CODE>
213 Returns a predicated (validating) buffer backed by the given buffer.
</TD>
215 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
216 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
217 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
218 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#synchronizedBuffer(org.apache.commons.collections.Buffer)">synchronizedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</CODE>
221 Returns a synchronized buffer backed by the given buffer.
</TD>
223 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
224 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
225 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
226 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#transformedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Transformer)">transformedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
227 <A HREF=
"../../../../org/apache/commons/collections/Transformer.html" title=
"interface in org.apache.commons.collections">Transformer
</A> transformer)
</CODE>
230 Returns a transformed buffer backed by the given buffer.
</TD>
232 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
233 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
234 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
235 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#typedBuffer(org.apache.commons.collections.Buffer, java.lang.Class)">typedBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
236 java.lang.Class
type)
</CODE>
239 Returns a typed buffer backed by the given buffer.
</TD>
241 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
242 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
243 <CODE>static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></FONT></TD>
244 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BufferUtils.html#unmodifiableBuffer(org.apache.commons.collections.Buffer)">unmodifiableBuffer
</A></B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</CODE>
247 Returns an unmodifiable buffer backed by the given buffer.
</TD>
250 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
251 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
252 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
253 <TH ALIGN=
"left"><B>Methods inherited from class java.lang.Object
</B></TH>
255 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
256 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
262 <!-- ============ FIELD DETAIL =========== -->
264 <A NAME=
"field_detail"><!-- --></A>
265 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
266 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
267 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
268 <B>Field Detail
</B></FONT></TH>
272 <A NAME=
"EMPTY_BUFFER"><!-- --></A><H3>
275 public static final
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>EMPTY_BUFFER
</B></PRE>
277 <DD>An empty unmodifiable buffer.
283 <!-- ========= CONSTRUCTOR DETAIL ======== -->
285 <A NAME=
"constructor_detail"><!-- --></A>
286 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
287 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
288 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
289 <B>Constructor Detail
</B></FONT></TH>
293 <A NAME=
"BufferUtils()"><!-- --></A><H3>
296 public
<B>BufferUtils
</B>()
</PRE>
298 <DD><code>BufferUtils
</code> should not normally be instantiated.
302 <!-- ============ METHOD DETAIL ========== -->
304 <A NAME=
"method_detail"><!-- --></A>
305 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
306 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
307 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
308 <B>Method Detail
</B></FONT></TH>
312 <A NAME=
"synchronizedBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
313 synchronizedBuffer
</H3>
315 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>synchronizedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</PRE>
317 <DD>Returns a synchronized buffer backed by the given buffer.
318 Much like the synchronized collections returned by
319 <CODE>Collections
</CODE>, you must manually synchronize on
320 the returned buffer's iterator to avoid non-deterministic behavior:
323 Buffer b = BufferUtils.synchronizedBuffer(myBuffer);
325 Iterator i = b.iterator();
326 while (i.hasNext()) {
333 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to synchronize, must not be null
334 <DT><B>Returns:
</B><DD>a synchronized buffer backed by that buffer
336 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer is null
</DL>
341 <A NAME=
"blockingBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
344 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>blockingBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</PRE>
346 <DD>Returns a synchronized buffer backed by the given buffer that will
347 block on
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations.
348 If the buffer is empty, then the
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
349 <A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations will block until new elements
350 are added to the buffer, rather than immediately throwing a
351 <code>BufferUnderflowException
</code>.
354 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to synchronize, must not be null
355 <DT><B>Returns:
</B><DD>a blocking buffer backed by that buffer
357 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer is null
</DL>
362 <A NAME=
"blockingBuffer(org.apache.commons.collections.Buffer, long)"><!-- --></A><H3>
365 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>blockingBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
366 long
timeoutMillis)
</PRE>
368 <DD>Returns a synchronized buffer backed by the given buffer that will
369 block on
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations
370 until
<code>timeout
</code> expires. If the buffer is empty, then the
371 <A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()"><CODE>Buffer.get()
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()"><CODE>Buffer.remove()
</CODE></A> operations will block
372 until new elements are added to the buffer, rather than immediately
373 throwing a
<code>BufferUnderflowException
</code>.
376 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to synchronize, must not be null
<DD><CODE>timeoutMillis
</CODE> - the timeout value in milliseconds, zero or less for no timeout
377 <DT><B>Returns:
</B><DD>a blocking buffer backed by that buffer
379 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer is null
<DT><B>Since:
</B></DT>
380 <DD>Commons Collections
3.2</DD>
386 <A NAME=
"boundedBuffer(org.apache.commons.collections.Buffer, int)"><!-- --></A><H3>
389 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>boundedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
390 int
maximumSize)
</PRE>
392 <DD>Returns a synchronized buffer backed by the given buffer that will
393 block on
<CODE>Collection.add(Object)
</CODE> and
394 <CODE>Collection.addAll(java.util.Collection)
</CODE> until enough object(s) are
395 removed from the buffer to allow the object(s) to be added and still
396 maintain the maximum size.
399 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to make bounded, must not be null
<DD><CODE>maximumSize
</CODE> - the maximum size
400 <DT><B>Returns:
</B><DD>a bounded buffer backed by the given buffer
402 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the given buffer is null
<DT><B>Since:
</B></DT>
403 <DD>Commons Collections
3.2</DD>
409 <A NAME=
"boundedBuffer(org.apache.commons.collections.Buffer, int, long)"><!-- --></A><H3>
412 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>boundedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
413 int
maximumSize,
414 long
timeoutMillis)
</PRE>
416 <DD>Returns a synchronized buffer backed by the given buffer that will
417 block on
<CODE>Collection.add(Object)
</CODE> and
418 <CODE>Collection.addAll(java.util.Collection)
</CODE> until enough object(s) are
419 removed from the buffer to allow the object(s) to be added and still
420 maintain the maximum size or the timeout expires.
423 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to make bounded, must not be null
<DD><CODE>maximumSize
</CODE> - the maximum size
<DD><CODE>timeoutMillis
</CODE> - the timeout value in milliseconds, zero or less for no timeout
424 <DT><B>Returns:
</B><DD>a bounded buffer backed by the given buffer
426 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the given buffer is null
<DT><B>Since:
</B></DT>
427 <DD>Commons Collections
3.2</DD>
433 <A NAME=
"unmodifiableBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
434 unmodifiableBuffer
</H3>
436 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>unmodifiableBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer)
</PRE>
438 <DD>Returns an unmodifiable buffer backed by the given buffer.
441 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to make unmodifiable, must not be null
442 <DT><B>Returns:
</B><DD>an unmodifiable buffer backed by that buffer
444 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer is null
</DL>
449 <A NAME=
"predicatedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Predicate)"><!-- --></A><H3>
450 predicatedBuffer
</H3>
452 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>predicatedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
453 <A HREF=
"../../../../org/apache/commons/collections/Predicate.html" title=
"interface in org.apache.commons.collections">Predicate
</A> predicate)
</PRE>
455 <DD>Returns a predicated (validating) buffer backed by the given buffer.
457 Only objects that pass the test in the given predicate can be added to the buffer.
458 Trying to add an invalid object results in an IllegalArgumentException.
459 It is important not to use the original buffer after invoking this method,
460 as it is a backdoor for adding invalid objects.
463 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to predicate, must not be null
<DD><CODE>predicate
</CODE> - the predicate used to evaluate new elements, must not be null
464 <DT><B>Returns:
</B><DD>a predicated buffer
466 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer or Predicate is null
</DL>
471 <A NAME=
"typedBuffer(org.apache.commons.collections.Buffer, java.lang.Class)"><!-- --></A><H3>
474 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>typedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
475 java.lang.Class
type)
</PRE>
477 <DD>Returns a typed buffer backed by the given buffer.
479 Only elements of the specified type can be added to the buffer.
482 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to predicate, must not be null
<DD><CODE>type
</CODE> - the type to allow into the buffer, must not be null
483 <DT><B>Returns:
</B><DD>a typed buffer
485 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the buffer or type is null
</DL>
490 <A NAME=
"transformedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Transformer)"><!-- --></A><H3>
491 transformedBuffer
</H3>
493 public static
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> <B>transformedBuffer
</B>(
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A> buffer,
494 <A HREF=
"../../../../org/apache/commons/collections/Transformer.html" title=
"interface in org.apache.commons.collections">Transformer
</A> transformer)
</PRE>
496 <DD>Returns a transformed buffer backed by the given buffer.
498 Each object is passed through the transformer as it is added to the
499 Buffer. It is important not to use the original buffer after invoking this
500 method, as it is a backdoor for adding untransformed objects.
503 <DT><B>Parameters:
</B><DD><CODE>buffer
</CODE> - the buffer to predicate, must not be null
<DD><CODE>transformer
</CODE> - the transformer for the buffer, must not be null
504 <DT><B>Returns:
</B><DD>a transformed buffer backed by the given buffer
506 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if the Buffer or Transformer is null
</DL>
509 <!-- ========= END OF CLASS DATA ========= -->
513 <!-- ======= START OF BOTTOM NAVBAR ====== -->
514 <A NAME=
"navbar_bottom"><!-- --></A>
515 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
516 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
518 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
519 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
520 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
521 <TR ALIGN=
"center" VALIGN=
"top">
522 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
523 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
524 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
525 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/BufferUtils.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
526 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
527 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
528 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
529 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
533 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
539 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
540 <A HREF=
"../../../../org/apache/commons/collections/BufferUnderflowException.html" title=
"class in org.apache.commons.collections"><B>PREV CLASS
</B></A>
541 <A HREF=
"../../../../org/apache/commons/collections/Closure.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
542 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
543 <A HREF=
"../../../../index.html?org/apache/commons/collections/BufferUtils.html" target=
"_top"><B>FRAMES
</B></A>
544 <A HREF=
"BufferUtils.html" target=
"_top"><B>NO FRAMES
</B></A>
545 <SCRIPT type=
"text/javascript">
548 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
553 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
560 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
561 SUMMARY:
NESTED
|
<A HREF=
"#field_summary">FIELD
</A> |
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
562 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
563 DETAIL:
<A HREF=
"#field_detail">FIELD
</A> |
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
566 <A NAME=
"skip-navbar_bottom"></A>
567 <!-- ======== END OF BOTTOM NAVBAR ======= -->
570 Copyright ©
2001-
2008 <a href=
"http://www.apache.org/">The Apache Software Foundation
</a>. All Rights Reserved.