📄 boundedbuffer.html
字号:
</TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="DEFAULT_CAPACITY"><!-- --></A><H3>DEFAULT_CAPACITY</H3><PRE>public static final int <B>DEFAULT_CAPACITY</B></PRE><DL><DD>The default capacity.</DL><HR><A NAME="array_"><!-- --></A><H3>array_</H3><PRE>protected final java.lang.Object[] <B>array_</B></PRE><DL></DL><HR><A NAME="takePtr_"><!-- --></A><H3>takePtr_</H3><PRE>protected int <B>takePtr_</B></PRE><DL></DL><HR><A NAME="putPtr_"><!-- --></A><H3>putPtr_</H3><PRE>protected int <B>putPtr_</B></PRE><DL></DL><HR><A NAME="usedSlots_"><!-- --></A><H3>usedSlots_</H3><PRE>protected int <B>usedSlots_</B></PRE><DL></DL><HR><A NAME="emptySlots_"><!-- --></A><H3>emptySlots_</H3><PRE>protected int <B>emptySlots_</B></PRE><DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="BoundedBuffer(int)"><!-- --></A><H3>BoundedBuffer</H3><PRE>public <B>BoundedBuffer</B>(int capacity) throws java.lang.IllegalArgumentException</PRE><DL><DD>Creates a buffer with the given capacity.<DD><DL><DT><B>Parameters:</B><DD><CODE>capacity</CODE> - the capacity.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if capacity less or equal to zero.</DL></DD></DL><HR><A NAME="BoundedBuffer()"><!-- --></A><H3>BoundedBuffer</H3><PRE>public <B>BoundedBuffer</B>()</PRE><DL><DD>Creates a buffer with the default capacity</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Returns the number of elements in the buffer. This is only a snapshot value, that may change immediately after returning.<DD><DL><DT><B>Returns:</B><DD>the size.</DL></DD></DL><HR><A NAME="capacity()"><!-- --></A><H3>capacity</H3><PRE>public int <B>capacity</B>()</PRE><DL><DD>Returns the capacity of the buffer.<DD><DL><DT><B>Returns:</B><DD>the capacity.</DL></DD></DL><HR><A NAME="peek()"><!-- --></A><H3>peek</H3><PRE>public java.lang.Object <B>peek</B>()</PRE><DL><DD>Peeks, but does not remove the top item from the buffer.<DD><DL><DT><B>Returns:</B><DD>the object or null.</DL></DD></DL><HR><A NAME="offer(java.lang.Object)"><!-- --></A><H3>offer</H3><PRE>public boolean <B>offer</B>(java.lang.Object x)</PRE><DL><DD>Puts an item in the buffer only if there is capacity available.<DD><DL><DT><B>Parameters:</B><DD><CODE>item</CODE> - the item to be inserted.<DT><B>Returns:</B><DD>true if accepted, else false.</DL></DD></DL><HR><A NAME="poll()"><!-- --></A><H3>poll</H3><PRE>public java.lang.Object <B>poll</B>()</PRE><DL><DD>Polls and removes the top item from the buffer if one is available.<DD><DL><DT><B>Returns:</B><DD>the oldest item from the buffer, or null if the buffer is empty.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BoundedBuffer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../../org/apache/turbine/util/pool/ObjectInputStreamForContext.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="BoundedBuffer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR>Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -