⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unbiasedqueue.synchronizedqueue.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<DL><DD>Return the next Object from the queue without removing it.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#peek()">peek</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Object, null if the queue is empty.</DL></DD></DL><HR><A NAME="pop()"><!-- --></A><H3>pop</H3><PRE>public java.lang.Object <B>pop</B>()</PRE><DL><DD>Remove and return the next Object from the queue.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pop()">pop</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Object, null if the queue is empty.</DL></DD></DL><HR><A NAME="pop(long)"><!-- --></A><H3>pop</H3><PRE>public java.lang.Object <B>pop</B>(long&nbsp;timeout)                     throws java.lang.InterruptedException</PRE><DL><DD>Gets a Object from the queue. If no Object is immediately available, then wait the specified amount of time for an Object to be inserted.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pop(long)">pop</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>timeout</CODE> - Amount of time to wait in milliseconds for an object to be available. Per Java convention, a timeout of zero (0) means wait an infinite amount of time. Negative values mean do not wait at all.<DT><B>Returns:</B><DD>The next object in the queue.<DT><B>Throws:</B><DD><CODE>java.lang.InterruptedException</CODE> - if the operation is interrupted before the timeout interval is completed.</DL></DD></DL><HR><A NAME="popMulti(int)"><!-- --></A><H3>popMulti</H3><PRE>public java.lang.Object[] <B>popMulti</B>(int&nbsp;maxObjs)</PRE><DL><DD>Returns an array of objects, possibly empty, from the queue.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#popMulti(int)">popMulti</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>maxObjs</CODE> - the maximum number of items to return.<DT><B>Returns:</B><DD>an array of objects, possibly empty containing the returned  queue elements.</DL></DD></DL><HR><A NAME="getMaxQueueSize()"><!-- --></A><H3>getMaxQueueSize</H3><PRE>public int <B>getMaxQueueSize</B>()</PRE><DL><DD>How many objects will fit in this queue<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getMaxQueueSize()">getMaxQueueSize</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>int indicating how many objects will fit in the queue.</DL></DD></DL><HR><A NAME="setMaxQueueSize(int)"><!-- --></A><H3>setMaxQueueSize</H3><PRE>public void <B>setMaxQueueSize</B>(int&nbsp;maxObjs)</PRE><DL><DD>Set how many objects this queue may store. Note that if there are more  objects already in the queue than the specified amount then the queue  will retain its current capacity.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#setMaxQueueSize(int)">setMaxQueueSize</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>maxObjs</CODE> - The number of objects which the queue must be able to  store.</DL></DD></DL><HR><A NAME="getCurrentInQueue()"><!-- --></A><H3>getCurrentInQueue</H3><PRE>public int <B>getCurrentInQueue</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></B></DD><DD>Return the number of elements currently in the queue. This method is  useful for statistical sampling, but should not be used to determine  program logic due to the multi-threaded behaviour of these queues.  <p/>You should use the return values and timeout behaviour of the  <A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#push(java.lang.Object)"><CODE>UnbiasedQueue.push(Object)</CODE></A> and <A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pop(long)"><CODE>UnbiasedQueue.pop(long)</CODE></A> methods to regulate how you  use the queue.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getCurrentInQueue()">getCurrentInQueue</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of elements currently in the queue. Be warned that  even two sequential calls to this method may return different answers  due to activity on other threads.</DL></DD></DL><HR><A NAME="getNumEnqueued()"><!-- --></A><H3>getNumEnqueued</H3><PRE>public long <B>getNumEnqueued</B>()</PRE><DL><DD>Return the total number of objects which have been enqueued on to this  queue during its existance.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getNumEnqueued()">getNumEnqueued</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>how many objects have been queued.</DL></DD></DL><HR><A NAME="getAvgInQueueAtEnqueue()"><!-- --></A><H3>getAvgInQueueAtEnqueue</H3><PRE>public double <B>getAvgInQueueAtEnqueue</B>()</PRE><DL><DD>Return the average number of elements in the queue at Enqueue time.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getAvgInQueueAtEnqueue()">getAvgInQueueAtEnqueue</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>average number of elements which were in the queue at during all  of the "push" operations which returned a "true" result. Does not  include the item being pushed. If no elements have ever been enqueued  then "NaN" will be returned.</DL></DD></DL><HR><A NAME="getNumDequeued()"><!-- --></A><H3>getNumDequeued</H3><PRE>public long <B>getNumDequeued</B>()</PRE><DL><DD>Return the total number of objects which have been dequeued from this  queue during its existance.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getNumDequeued()">getNumDequeued</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>how many objects have been queued.</DL></DD></DL><HR><A NAME="getAvgInQueueAtDequeue()"><!-- --></A><H3>getAvgInQueueAtDequeue</H3><PRE>public double <B>getAvgInQueueAtDequeue</B>()</PRE><DL><DD>Return the average number of elements in the queue at dequeue time.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getAvgInQueueAtDequeue()">getAvgInQueueAtDequeue</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>average number of elements which were in the queue at during all  of the "pop" operations which returned a non-null result. Includes the item being "pop"ed in the average. If no elements have ever been dequeued  then "NaN" will be returned.</DL></DD></DL><HR><A NAME="getNumDropped()"><!-- --></A><H3>getNumDropped</H3><PRE>public long <B>getNumDropped</B>()</PRE><DL><DD>Return the total number of objects which have been dropped by this queue  during its existance.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#getNumDropped()">getNumDropped</A></CODE> in class <CODE><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>how many objects have been dropped.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/UnbiasedQueue.SynchronizedQueue.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>JXTA J2SE</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="UnbiasedQueue.SynchronizedQueue.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_net.jxta.impl.util.UnbiasedQueue">NESTED</A>&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><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">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></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -