a whole bunch of stuff
[ephemerata.git] / KezvhLib / lib / org.apache.commons.collections / apidocs / org / apache / commons / collections / BufferUtils.html
blob296dbe171e26966b4a1aedf34faef99f71f47f8d
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
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">
7 <TITLE>
8 BufferUtils (Commons Collections 3.2.1 API)
9 </TITLE>
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)";
20 </SCRIPT>
21 <NOSCRIPT>
22 </NOSCRIPT>
24 </HEAD>
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="">
33 <TR>
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>&nbsp;</TD>
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
40 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BufferUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
46 </TR>
47 </TABLE>
48 </TD>
49 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
50 </EM>
51 </TD>
52 </TR>
54 <TR>
55 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
56 &nbsp;<A HREF="../../../../org/apache/commons/collections/BufferUnderflowException.html" title="class in org.apache.commons.collections"><B>PREV CLASS</B></A>&nbsp;
57 &nbsp;<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> &nbsp;
60 &nbsp;<A HREF="BufferUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
61 &nbsp;<SCRIPT type="text/javascript">
62 <!--
63 if(window==top) {
64 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
66 //-->
67 </SCRIPT>
68 <NOSCRIPT>
69 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
70 </NOSCRIPT>
73 </FONT></TD>
74 </TR>
75 <TR>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
80 </TR>
81 </TABLE>
82 <A NAME="skip-navbar_top"></A>
83 <!-- ========= END OF TOP NAVBAR ========= -->
85 <HR>
86 <!-- ======== START OF CLASS DATA ======== -->
87 <H2>
88 <FONT SIZE="-1">
89 org.apache.commons.collections</FONT>
90 <BR>
91 Class BufferUtils</H2>
92 <PRE>
93 java.lang.Object
94 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.collections.BufferUtils</B>
95 </PRE>
96 <HR>
97 <DL>
98 <DT><PRE>public class <B>BufferUtils</B><DT>extends java.lang.Object</DL>
99 </PRE>
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.
106 <DL>
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>
113 </DL>
114 <HR>
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>
124 </TR>
125 <TR BGCOLOR="white" CLASS="TableRowColor">
126 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
127 <CODE>static&nbsp;<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>
130 <BR>
131 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An empty unmodifiable buffer.</TD>
132 </TR>
133 </TABLE>
134 &nbsp;
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>
142 </TR>
143 <TR BGCOLOR="white" CLASS="TableRowColor">
144 <TD><CODE><B><A HREF="../../../../org/apache/commons/collections/BufferUtils.html#BufferUtils()">BufferUtils</A></B>()</CODE>
146 <BR>
147 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>BufferUtils</code> should not normally be instantiated.</TD>
148 </TR>
149 </TABLE>
150 &nbsp;
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>
158 </TR>
159 <TR BGCOLOR="white" CLASS="TableRowColor">
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
161 <CODE>static&nbsp;<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>&nbsp;buffer)</CODE>
164 <BR>
165 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
167 </TR>
168 <TR BGCOLOR="white" CLASS="TableRowColor">
169 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
170 <CODE>static&nbsp;<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>&nbsp;buffer,
172 long&nbsp;timeoutMillis)</CODE>
174 <BR>
175 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
178 </TR>
179 <TR BGCOLOR="white" CLASS="TableRowColor">
180 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
181 <CODE>static&nbsp;<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>&nbsp;buffer,
183 int&nbsp;maximumSize)</CODE>
185 <BR>
186 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
191 </TR>
192 <TR BGCOLOR="white" CLASS="TableRowColor">
193 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
194 <CODE>static&nbsp;<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>&nbsp;buffer,
196 int&nbsp;maximumSize,
197 long&nbsp;timeoutMillis)</CODE>
199 <BR>
200 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
205 </TR>
206 <TR BGCOLOR="white" CLASS="TableRowColor">
207 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
208 <CODE>static&nbsp;<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>&nbsp;buffer,
210 <A HREF="../../../../org/apache/commons/collections/Predicate.html" title="interface in org.apache.commons.collections">Predicate</A>&nbsp;predicate)</CODE>
212 <BR>
213 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a predicated (validating) buffer backed by the given buffer.</TD>
214 </TR>
215 <TR BGCOLOR="white" CLASS="TableRowColor">
216 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217 <CODE>static&nbsp;<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>&nbsp;buffer)</CODE>
220 <BR>
221 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a synchronized buffer backed by the given buffer.</TD>
222 </TR>
223 <TR BGCOLOR="white" CLASS="TableRowColor">
224 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
225 <CODE>static&nbsp;<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>&nbsp;buffer,
227 <A HREF="../../../../org/apache/commons/collections/Transformer.html" title="interface in org.apache.commons.collections">Transformer</A>&nbsp;transformer)</CODE>
229 <BR>
230 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a transformed buffer backed by the given buffer.</TD>
231 </TR>
232 <TR BGCOLOR="white" CLASS="TableRowColor">
233 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
234 <CODE>static&nbsp;<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>&nbsp;buffer,
236 java.lang.Class&nbsp;type)</CODE>
238 <BR>
239 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a typed buffer backed by the given buffer.</TD>
240 </TR>
241 <TR BGCOLOR="white" CLASS="TableRowColor">
242 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243 <CODE>static&nbsp;<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>&nbsp;buffer)</CODE>
246 <BR>
247 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an unmodifiable buffer backed by the given buffer.</TD>
248 </TR>
249 </TABLE>
250 &nbsp;<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>
254 </TR>
255 <TR BGCOLOR="white" CLASS="TableRowColor">
256 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
257 </TR>
258 </TABLE>
259 &nbsp;
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>
269 </TR>
270 </TABLE>
272 <A NAME="EMPTY_BUFFER"><!-- --></A><H3>
273 EMPTY_BUFFER</H3>
274 <PRE>
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>
276 <DL>
277 <DD>An empty unmodifiable buffer.
279 <DL>
280 </DL>
281 </DL>
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>
290 </TR>
291 </TABLE>
293 <A NAME="BufferUtils()"><!-- --></A><H3>
294 BufferUtils</H3>
295 <PRE>
296 public <B>BufferUtils</B>()</PRE>
297 <DL>
298 <DD><code>BufferUtils</code> should not normally be instantiated.
300 </DL>
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>
309 </TR>
310 </TABLE>
312 <A NAME="synchronizedBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
313 synchronizedBuffer</H3>
314 <PRE>
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>&nbsp;buffer)</PRE>
316 <DL>
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:
322 <pre>
323 Buffer b = BufferUtils.synchronizedBuffer(myBuffer);
324 synchronized (b) {
325 Iterator i = b.iterator();
326 while (i.hasNext()) {
327 process (i.next());
330 </pre>
332 <DD><DL>
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
335 <DT><B>Throws:</B>
336 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer is null</DL>
337 </DD>
338 </DL>
339 <HR>
341 <A NAME="blockingBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
342 blockingBuffer</H3>
343 <PRE>
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>&nbsp;buffer)</PRE>
345 <DL>
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>.
353 <DD><DL>
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
356 <DT><B>Throws:</B>
357 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer is null</DL>
358 </DD>
359 </DL>
360 <HR>
362 <A NAME="blockingBuffer(org.apache.commons.collections.Buffer, long)"><!-- --></A><H3>
363 blockingBuffer</H3>
364 <PRE>
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>&nbsp;buffer,
366 long&nbsp;timeoutMillis)</PRE>
367 <DL>
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>.
375 <DD><DL>
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
378 <DT><B>Throws:</B>
379 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer is null<DT><B>Since:</B></DT>
380 <DD>Commons Collections 3.2</DD>
381 </DL>
382 </DD>
383 </DL>
384 <HR>
386 <A NAME="boundedBuffer(org.apache.commons.collections.Buffer, int)"><!-- --></A><H3>
387 boundedBuffer</H3>
388 <PRE>
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>&nbsp;buffer,
390 int&nbsp;maximumSize)</PRE>
391 <DL>
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.
398 <DD><DL>
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
401 <DT><B>Throws:</B>
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>
404 </DL>
405 </DD>
406 </DL>
407 <HR>
409 <A NAME="boundedBuffer(org.apache.commons.collections.Buffer, int, long)"><!-- --></A><H3>
410 boundedBuffer</H3>
411 <PRE>
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>&nbsp;buffer,
413 int&nbsp;maximumSize,
414 long&nbsp;timeoutMillis)</PRE>
415 <DL>
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.
422 <DD><DL>
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
425 <DT><B>Throws:</B>
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>
428 </DL>
429 </DD>
430 </DL>
431 <HR>
433 <A NAME="unmodifiableBuffer(org.apache.commons.collections.Buffer)"><!-- --></A><H3>
434 unmodifiableBuffer</H3>
435 <PRE>
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>&nbsp;buffer)</PRE>
437 <DL>
438 <DD>Returns an unmodifiable buffer backed by the given buffer.
440 <DD><DL>
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
443 <DT><B>Throws:</B>
444 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer is null</DL>
445 </DD>
446 </DL>
447 <HR>
449 <A NAME="predicatedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Predicate)"><!-- --></A><H3>
450 predicatedBuffer</H3>
451 <PRE>
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>&nbsp;buffer,
453 <A HREF="../../../../org/apache/commons/collections/Predicate.html" title="interface in org.apache.commons.collections">Predicate</A>&nbsp;predicate)</PRE>
454 <DL>
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.
462 <DD><DL>
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
465 <DT><B>Throws:</B>
466 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer or Predicate is null</DL>
467 </DD>
468 </DL>
469 <HR>
471 <A NAME="typedBuffer(org.apache.commons.collections.Buffer, java.lang.Class)"><!-- --></A><H3>
472 typedBuffer</H3>
473 <PRE>
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>&nbsp;buffer,
475 java.lang.Class&nbsp;type)</PRE>
476 <DL>
477 <DD>Returns a typed buffer backed by the given buffer.
479 Only elements of the specified type can be added to the buffer.
481 <DD><DL>
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
484 <DT><B>Throws:</B>
485 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the buffer or type is null</DL>
486 </DD>
487 </DL>
488 <HR>
490 <A NAME="transformedBuffer(org.apache.commons.collections.Buffer, org.apache.commons.collections.Transformer)"><!-- --></A><H3>
491 transformedBuffer</H3>
492 <PRE>
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>&nbsp;buffer,
494 <A HREF="../../../../org/apache/commons/collections/Transformer.html" title="interface in org.apache.commons.collections">Transformer</A>&nbsp;transformer)</PRE>
495 <DL>
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.
502 <DD><DL>
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
505 <DT><B>Throws:</B>
506 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the Buffer or Transformer is null</DL>
507 </DD>
508 </DL>
509 <!-- ========= END OF CLASS DATA ========= -->
510 <HR>
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="">
517 <TR>
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>&nbsp;</TD>
523 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
524 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
525 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BufferUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
526 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
527 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
528 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
529 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
530 </TR>
531 </TABLE>
532 </TD>
533 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
534 </EM>
535 </TD>
536 </TR>
538 <TR>
539 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
540 &nbsp;<A HREF="../../../../org/apache/commons/collections/BufferUnderflowException.html" title="class in org.apache.commons.collections"><B>PREV CLASS</B></A>&nbsp;
541 &nbsp;<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> &nbsp;
544 &nbsp;<A HREF="BufferUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
545 &nbsp;<SCRIPT type="text/javascript">
546 <!--
547 if(window==top) {
548 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
550 //-->
551 </SCRIPT>
552 <NOSCRIPT>
553 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
554 </NOSCRIPT>
557 </FONT></TD>
558 </TR>
559 <TR>
560 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
561 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
562 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
563 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
564 </TR>
565 </TABLE>
566 <A NAME="skip-navbar_bottom"></A>
567 <!-- ======== END OF BOTTOM NAVBAR ======= -->
569 <HR>
570 Copyright © 2001-2008 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
571 </BODY>
572 </HTML>