a whole bunch of stuff
[ephemerata.git] / KezvhLib / lib / org.apache.commons.collections / apidocs / org / apache / commons / collections / buffer / BoundedBuffer.html
blobf4beca422956fcbde84d3f1c09f64c1a75db3677
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:18 BST 2008 -->
6 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7 <TITLE>
8 BoundedBuffer (Commons Collections 3.2.1 API)
9 </TITLE>
11 <META NAME="keywords" CONTENT="org.apache.commons.collections.buffer.BoundedBuffer 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="BoundedBuffer (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/BoundedBuffer.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/buffer/BlockingBuffer.html" title="class in org.apache.commons.collections.buffer"><B>PREV CLASS</B></A>&nbsp;
57 &nbsp;<A HREF="../../../../../org/apache/commons/collections/buffer/BoundedFifoBuffer.html" title="class in org.apache.commons.collections.buffer"><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/buffer/BoundedBuffer.html" target="_top"><B>FRAMES</B></A> &nbsp;
60 &nbsp;<A HREF="BoundedBuffer.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="#fields_inherited_from_class_org.apache.commons.collections.collection.SynchronizedCollection">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;FIELD&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.buffer</FONT>
90 <BR>
91 Class BoundedBuffer</H2>
92 <PRE>
93 java.lang.Object
94 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">org.apache.commons.collections.collection.SynchronizedCollection</A>
95 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html" title="class in org.apache.commons.collections.buffer">org.apache.commons.collections.buffer.SynchronizedBuffer</A>
96 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.collections.buffer.BoundedBuffer</B>
97 </PRE>
98 <DL>
99 <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, java.lang.Iterable, java.util.Collection, <A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html" title="interface in org.apache.commons.collections">BoundedCollection</A>, <A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A></DD>
100 </DL>
101 <HR>
102 <DL>
103 <DT><PRE>public class <B>BoundedBuffer</B><DT>extends <A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html" title="class in org.apache.commons.collections.buffer">SynchronizedBuffer</A><DT>implements <A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html" title="interface in org.apache.commons.collections">BoundedCollection</A></DL>
104 </PRE>
107 Decorates another <code>Buffer</code> to ensure a fixed maximum size.
109 Note: This class should only be used if you need to add bounded
110 behaviour to another buffer. If you just want a bounded buffer then
111 you should use <A HREF="../../../../../org/apache/commons/collections/buffer/BoundedFifoBuffer.html" title="class in org.apache.commons.collections.buffer"><CODE>BoundedFifoBuffer</CODE></A> or <A HREF="../../../../../org/apache/commons/collections/buffer/CircularFifoBuffer.html" title="class in org.apache.commons.collections.buffer"><CODE>CircularFifoBuffer</CODE></A>.
113 The decoration methods allow you to specify a timeout value.
114 This alters the behaviour of the add methods when the buffer is full.
115 Normally, when the buffer is full, the add method will throw an exception.
116 With a timeout, the add methods will wait for up to the timeout period
117 to try and add the elements.
121 <DL>
122 <DT><B>Since:</B></DT>
123 <DD>Commons Collections 3.2</DD>
124 <DT><B>Version:</B></DT>
125 <DD>$Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $</DD>
126 <DT><B>Author:</B></DT>
127 <DD>James Carman, Stephen Colebourne</DD>
128 <DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.commons.collections.buffer.BoundedBuffer">Serialized Form</A></DL>
129 <HR>
132 <!-- =========== FIELD SUMMARY =========== -->
134 <A NAME="field_summary"><!-- --></A>
135 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
136 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
137 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
138 <B>Field Summary</B></FONT></TH>
139 </TR>
140 </TABLE>
141 &nbsp;<A NAME="fields_inherited_from_class_org.apache.commons.collections.collection.SynchronizedCollection"><!-- --></A>
142 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
143 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
144 <TH ALIGN="left"><B>Fields inherited from class org.apache.commons.collections.collection.<A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">SynchronizedCollection</A></B></TH>
145 </TR>
146 <TR BGCOLOR="white" CLASS="TableRowColor">
147 <TD><CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#collection">collection</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#lock">lock</A></CODE></TD>
148 </TR>
149 </TABLE>
150 &nbsp;
151 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
153 <A NAME="constructor_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>Constructor 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>protected </CODE></FONT></TD>
162 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.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,
163 int&nbsp;maximumSize,
164 long&nbsp;timeout)</CODE>
166 <BR>
167 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor that wraps (not copies) another buffer, making it bounded
168 waiting only up to a maximum amount of time.</TD>
169 </TR>
170 </TABLE>
171 &nbsp;
172 <!-- ========== METHOD SUMMARY =========== -->
174 <A NAME="method_summary"><!-- --></A>
175 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
176 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
177 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
178 <B>Method Summary</B></FONT></TH>
179 </TR>
180 <TR BGCOLOR="white" CLASS="TableRowColor">
181 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
182 <CODE>&nbsp;boolean</CODE></FONT></TD>
183 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#add(java.lang.Object)">add</A></B>(java.lang.Object&nbsp;o)</CODE>
185 <BR>
186 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
187 </TR>
188 <TR BGCOLOR="white" CLASS="TableRowColor">
189 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
190 <CODE>&nbsp;boolean</CODE></FONT></TD>
191 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#addAll(java.util.Collection)">addAll</A></B>(java.util.Collection&nbsp;c)</CODE>
193 <BR>
194 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
195 </TR>
196 <TR BGCOLOR="white" CLASS="TableRowColor">
197 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198 <CODE>static&nbsp;<A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html" title="class in org.apache.commons.collections.buffer">BoundedBuffer</A></CODE></FONT></TD>
199 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#decorate(org.apache.commons.collections.Buffer, int)">decorate</A></B>(<A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A>&nbsp;buffer,
200 int&nbsp;maximumSize)</CODE>
202 <BR>
203 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Factory method to create a bounded buffer.</TD>
204 </TR>
205 <TR BGCOLOR="white" CLASS="TableRowColor">
206 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
207 <CODE>static&nbsp;<A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html" title="class in org.apache.commons.collections.buffer">BoundedBuffer</A></CODE></FONT></TD>
208 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#decorate(org.apache.commons.collections.Buffer, int, long)">decorate</A></B>(<A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A>&nbsp;buffer,
209 int&nbsp;maximumSize,
210 long&nbsp;timeout)</CODE>
212 <BR>
213 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Factory method to create a bounded buffer that blocks for a maximum
214 amount of time.</TD>
215 </TR>
216 <TR BGCOLOR="white" CLASS="TableRowColor">
217 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
218 <CODE>&nbsp;boolean</CODE></FONT></TD>
219 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#isFull()">isFull</A></B>()</CODE>
221 <BR>
222 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if this collection is full and no new elements can be added.</TD>
223 </TR>
224 <TR BGCOLOR="white" CLASS="TableRowColor">
225 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
226 <CODE>&nbsp;java.util.Iterator</CODE></FONT></TD>
227 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#iterator()">iterator</A></B>()</CODE>
229 <BR>
230 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Iterators must be manually synchronized.</TD>
231 </TR>
232 <TR BGCOLOR="white" CLASS="TableRowColor">
233 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
234 <CODE>&nbsp;int</CODE></FONT></TD>
235 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#maxSize()">maxSize</A></B>()</CODE>
237 <BR>
238 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the maximum size of the collection (the bound).</TD>
239 </TR>
240 <TR BGCOLOR="white" CLASS="TableRowColor">
241 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
242 <CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
243 <TD><CODE><B><A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html#remove()">remove</A></B>()</CODE>
245 <BR>
246 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets and removes the next object from the buffer.</TD>
247 </TR>
248 </TABLE>
249 &nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.collections.buffer.SynchronizedBuffer"><!-- --></A>
250 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
251 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
252 <TH ALIGN="left"><B>Methods inherited from class org.apache.commons.collections.buffer.<A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html" title="class in org.apache.commons.collections.buffer">SynchronizedBuffer</A></B></TH>
253 </TR>
254 <TR BGCOLOR="white" CLASS="TableRowColor">
255 <TD><CODE><A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html#decorate(org.apache.commons.collections.Buffer)">decorate</A>, <A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html#get()">get</A>, <A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html#getBuffer()">getBuffer</A></CODE></TD>
256 </TR>
257 </TABLE>
258 &nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.collections.collection.SynchronizedCollection"><!-- --></A>
259 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
260 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
261 <TH ALIGN="left"><B>Methods inherited from class org.apache.commons.collections.collection.<A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">SynchronizedCollection</A></B></TH>
262 </TR>
263 <TR BGCOLOR="white" CLASS="TableRowColor">
264 <TD><CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#clear()">clear</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#contains(java.lang.Object)">contains</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#containsAll(java.util.Collection)">containsAll</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#decorate(java.util.Collection)">decorate</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#hashCode()">hashCode</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#isEmpty()">isEmpty</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#remove(java.lang.Object)">remove</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#removeAll(java.util.Collection)">removeAll</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#retainAll(java.util.Collection)">retainAll</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#size()">size</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#toArray()">toArray</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#toArray(java.lang.Object[])">toArray</A>, <A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#toString()">toString</A></CODE></TD>
265 </TR>
266 </TABLE>
267 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
268 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
269 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
270 <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
271 </TR>
272 <TR BGCOLOR="white" CLASS="TableRowColor">
273 <TD><CODE>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD>
274 </TR>
275 </TABLE>
276 &nbsp;<A NAME="methods_inherited_from_class_java.util.Collection"><!-- --></A>
277 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
278 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
279 <TH ALIGN="left"><B>Methods inherited from interface java.util.Collection</B></TH>
280 </TR>
281 <TR BGCOLOR="white" CLASS="TableRowColor">
282 <TD><CODE>clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray</CODE></TD>
283 </TR>
284 </TABLE>
285 &nbsp;
288 <!-- ========= CONSTRUCTOR DETAIL ======== -->
290 <A NAME="constructor_detail"><!-- --></A>
291 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
292 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
293 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
294 <B>Constructor Detail</B></FONT></TH>
295 </TR>
296 </TABLE>
298 <A NAME="BoundedBuffer(org.apache.commons.collections.Buffer, int, long)"><!-- --></A><H3>
299 BoundedBuffer</H3>
300 <PRE>
301 protected <B>BoundedBuffer</B>(<A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A>&nbsp;buffer,
302 int&nbsp;maximumSize,
303 long&nbsp;timeout)</PRE>
304 <DL>
305 <DD>Constructor that wraps (not copies) another buffer, making it bounded
306 waiting only up to a maximum amount of time.
308 <DL>
309 <DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the buffer to wrap, must not be null<DD><CODE>maximumSize</CODE> - the maximum size, must be size one or greater<DD><CODE>timeout</CODE> - the maximum amount of time to wait
310 <DT><B>Throws:</B>
311 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the buffer is null
312 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the maximum size is zero or less</DL>
313 </DL>
315 <!-- ============ METHOD DETAIL ========== -->
317 <A NAME="method_detail"><!-- --></A>
318 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
319 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
320 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
321 <B>Method Detail</B></FONT></TH>
322 </TR>
323 </TABLE>
325 <A NAME="decorate(org.apache.commons.collections.Buffer, int)"><!-- --></A><H3>
326 decorate</H3>
327 <PRE>
328 public static <A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html" title="class in org.apache.commons.collections.buffer">BoundedBuffer</A> <B>decorate</B>(<A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A>&nbsp;buffer,
329 int&nbsp;maximumSize)</PRE>
330 <DL>
331 <DD>Factory method to create a bounded buffer.
333 When the buffer is full, it will immediately throw a
334 <code>BufferOverflowException</code> on calling <code>add()</code>.
336 <DD><DL>
337 </DL>
338 </DD>
339 <DD><DL>
340 <DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the buffer to decorate, must not be null<DD><CODE>maximumSize</CODE> - the maximum size, must be size one or greater
341 <DT><B>Returns:</B><DD>a new bounded buffer
342 <DT><B>Throws:</B>
343 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the buffer is null
344 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the maximum size is zero or less</DL>
345 </DD>
346 </DL>
347 <HR>
349 <A NAME="decorate(org.apache.commons.collections.Buffer, int, long)"><!-- --></A><H3>
350 decorate</H3>
351 <PRE>
352 public static <A HREF="../../../../../org/apache/commons/collections/buffer/BoundedBuffer.html" title="class in org.apache.commons.collections.buffer">BoundedBuffer</A> <B>decorate</B>(<A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A>&nbsp;buffer,
353 int&nbsp;maximumSize,
354 long&nbsp;timeout)</PRE>
355 <DL>
356 <DD>Factory method to create a bounded buffer that blocks for a maximum
357 amount of time.
359 <DD><DL>
360 </DL>
361 </DD>
362 <DD><DL>
363 <DT><B>Parameters:</B><DD><CODE>buffer</CODE> - the buffer to decorate, must not be null<DD><CODE>maximumSize</CODE> - the maximum size, must be size one or greater<DD><CODE>timeout</CODE> - the maximum amount of time to wait in milliseconds
364 <DT><B>Returns:</B><DD>a new bounded buffer
365 <DT><B>Throws:</B>
366 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the buffer is null
367 <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the maximum size is zero or less</DL>
368 </DD>
369 </DL>
370 <HR>
372 <A NAME="remove()"><!-- --></A><H3>
373 remove</H3>
374 <PRE>
375 public java.lang.Object <B>remove</B>()</PRE>
376 <DL>
377 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/collections/Buffer.html#remove()">Buffer</A></CODE></B></DD>
378 <DD>Gets and removes the next object from the buffer.
380 <DD><DL>
381 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/Buffer.html#remove()">remove</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/collections/Buffer.html" title="interface in org.apache.commons.collections">Buffer</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html#remove()">remove</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/collections/buffer/SynchronizedBuffer.html" title="class in org.apache.commons.collections.buffer">SynchronizedBuffer</A></CODE></DL>
382 </DD>
383 <DD><DL>
385 <DT><B>Returns:</B><DD>the next object in the buffer, which is also removed</DL>
386 </DD>
387 </DL>
388 <HR>
390 <A NAME="add(java.lang.Object)"><!-- --></A><H3>
391 add</H3>
392 <PRE>
393 public boolean <B>add</B>(java.lang.Object&nbsp;o)</PRE>
394 <DL>
395 <DD><DL>
396 <DT><B>Specified by:</B><DD><CODE>add</CODE> in interface <CODE>java.util.Collection</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#add(java.lang.Object)">add</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">SynchronizedCollection</A></CODE></DL>
397 </DD>
398 <DD><DL>
399 </DL>
400 </DD>
401 </DL>
402 <HR>
404 <A NAME="addAll(java.util.Collection)"><!-- --></A><H3>
405 addAll</H3>
406 <PRE>
407 public boolean <B>addAll</B>(java.util.Collection&nbsp;c)</PRE>
408 <DL>
409 <DD><DL>
410 <DT><B>Specified by:</B><DD><CODE>addAll</CODE> in interface <CODE>java.util.Collection</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#addAll(java.util.Collection)">addAll</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">SynchronizedCollection</A></CODE></DL>
411 </DD>
412 <DD><DL>
413 </DL>
414 </DD>
415 </DL>
416 <HR>
418 <A NAME="iterator()"><!-- --></A><H3>
419 iterator</H3>
420 <PRE>
421 public java.util.Iterator <B>iterator</B>()</PRE>
422 <DL>
423 <DD><B>Description copied from class: <CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#iterator()">SynchronizedCollection</A></CODE></B></DD>
424 <DD>Iterators must be manually synchronized.
425 <pre>
426 synchronized (coll) {
427 Iterator it = coll.iterator();
428 // do stuff with iterator
431 <DD><DL>
432 <DT><B>Specified by:</B><DD><CODE>iterator</CODE> in interface <CODE>java.lang.Iterable</CODE><DT><B>Specified by:</B><DD><CODE>iterator</CODE> in interface <CODE>java.util.Collection</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html#iterator()">iterator</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/collections/collection/SynchronizedCollection.html" title="class in org.apache.commons.collections.collection">SynchronizedCollection</A></CODE></DL>
433 </DD>
434 <DD><DL>
436 <DT><B>Returns:</B><DD>an iterator that must be manually synchronized on the collection</DL>
437 </DD>
438 </DL>
439 <HR>
441 <A NAME="isFull()"><!-- --></A><H3>
442 isFull</H3>
443 <PRE>
444 public boolean <B>isFull</B>()</PRE>
445 <DL>
446 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html#isFull()">BoundedCollection</A></CODE></B></DD>
447 <DD>Returns true if this collection is full and no new elements can be added.
449 <DD><DL>
450 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html#isFull()">isFull</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html" title="interface in org.apache.commons.collections">BoundedCollection</A></CODE></DL>
451 </DD>
452 <DD><DL>
454 <DT><B>Returns:</B><DD><code>true</code> if the collection is full</DL>
455 </DD>
456 </DL>
457 <HR>
459 <A NAME="maxSize()"><!-- --></A><H3>
460 maxSize</H3>
461 <PRE>
462 public int <B>maxSize</B>()</PRE>
463 <DL>
464 <DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html#maxSize()">BoundedCollection</A></CODE></B></DD>
465 <DD>Gets the maximum size of the collection (the bound).
467 <DD><DL>
468 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html#maxSize()">maxSize</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/collections/BoundedCollection.html" title="interface in org.apache.commons.collections">BoundedCollection</A></CODE></DL>
469 </DD>
470 <DD><DL>
472 <DT><B>Returns:</B><DD>the maximum number of elements the collection can hold</DL>
473 </DD>
474 </DL>
475 <!-- ========= END OF CLASS DATA ========= -->
476 <HR>
479 <!-- ======= START OF BOTTOM NAVBAR ====== -->
480 <A NAME="navbar_bottom"><!-- --></A>
481 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
482 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
483 <TR>
484 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
485 <A NAME="navbar_bottom_firstrow"><!-- --></A>
486 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
487 <TR ALIGN="center" VALIGN="top">
488 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
489 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
490 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
491 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BoundedBuffer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
492 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
493 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
494 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
495 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
496 </TR>
497 </TABLE>
498 </TD>
499 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
500 </EM>
501 </TD>
502 </TR>
504 <TR>
505 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
506 &nbsp;<A HREF="../../../../../org/apache/commons/collections/buffer/BlockingBuffer.html" title="class in org.apache.commons.collections.buffer"><B>PREV CLASS</B></A>&nbsp;
507 &nbsp;<A HREF="../../../../../org/apache/commons/collections/buffer/BoundedFifoBuffer.html" title="class in org.apache.commons.collections.buffer"><B>NEXT CLASS</B></A></FONT></TD>
508 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
509 <A HREF="../../../../../index.html?org/apache/commons/collections/buffer/BoundedBuffer.html" target="_top"><B>FRAMES</B></A> &nbsp;
510 &nbsp;<A HREF="BoundedBuffer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
511 &nbsp;<SCRIPT type="text/javascript">
512 <!--
513 if(window==top) {
514 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
516 //-->
517 </SCRIPT>
518 <NOSCRIPT>
519 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
520 </NOSCRIPT>
523 </FONT></TD>
524 </TR>
525 <TR>
526 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
527 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.commons.collections.collection.SynchronizedCollection">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
528 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
529 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
530 </TR>
531 </TABLE>
532 <A NAME="skip-navbar_bottom"></A>
533 <!-- ======== END OF BOTTOM NAVBAR ======= -->
535 <HR>
536 Copyright © 2001-2008 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
537 </BODY>
538 </HTML>