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

📄 unbiasedqueue.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#peek()">peek</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the next Object from the queue without removing it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pop()">pop</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove and return the next Object from the queue.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pop(long)">pop</A></B>(long&nbsp;timeout)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a Object from the queue. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.Object[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#popMulti(int)">popMulti</A></B>(int&nbsp;maxObjs)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of objects, possibly empty, from the queue.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#push(java.lang.Object)">push</A></B>(java.lang.Object&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempt to push an object onto the queue. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#push(java.lang.Object, long)">push</A></B>(java.lang.Object&nbsp;obj,     long&nbsp;timeout)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Push an object onto the queue. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pushBack(java.lang.Object)">pushBack</A></B>(java.lang.Object&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempt to push an object back at the head the queue. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#pushBack(java.lang.Object, long)">pushBack</A></B>(java.lang.Object&nbsp;obj,         long&nbsp;timeout)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Push an object back at the head of the queue. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#setMaxQueueSize(int)">setMaxQueueSize</A></B>(int&nbsp;maxObjs)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set how many objects this queue may store. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#synchronizedQueue(net.jxta.impl.util.UnbiasedQueue)">synchronizedQueue</A></B>(<A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A>&nbsp;queue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a synchronized (thread-safe) list backed by the specified queue.  </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <p/>A diagnostic toString implementation.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><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, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="DEFAULT_MAX_OBJECTS"><!-- --></A><H3>DEFAULT_MAX_OBJECTS</H3><PRE>protected static final int <B>DEFAULT_MAX_OBJECTS</B></PRE><DL><DD>Default number of queue elements.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#net.jxta.impl.util.UnbiasedQueue.DEFAULT_MAX_OBJECTS">Constant Field Values</A></DL></DL><HR><A NAME="DROP_OLDEST_OBJECT"><!-- --></A><H3>DROP_OLDEST_OBJECT</H3><PRE>protected static final boolean <B>DROP_OLDEST_OBJECT</B></PRE><DL><DD>Default object dropping behaviour<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#net.jxta.impl.util.UnbiasedQueue.DROP_OLDEST_OBJECT">Constant Field Values</A></DL></DL><HR><A NAME="DROPPED_OBJECT_WARNING_INTERVAL"><!-- --></A><H3>DROPPED_OBJECT_WARNING_INTERVAL</H3><PRE>protected static final long <B>DROPPED_OBJECT_WARNING_INTERVAL</B></PRE><DL><DD>Number of milliseconds between notifications that objects are being dropped.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#net.jxta.impl.util.UnbiasedQueue.DROPPED_OBJECT_WARNING_INTERVAL">Constant Field Values</A></DL></DL><HR><A NAME="queue"><!-- --></A><H3>queue</H3><PRE>protected java.util.List <B>queue</B></PRE><DL><DD>Contains the objects we currently have queued.<P><DL></DL></DL><HR><A NAME="maxObjects"><!-- --></A><H3>maxObjects</H3><PRE>protected int <B>maxObjects</B></PRE><DL><DD>The maximum number of objects we will hold in the queue at one time.<P><DL></DL></DL><HR><A NAME="closeFlag"><!-- --></A><H3>closeFlag</H3><PRE>protected volatile boolean <B>closeFlag</B></PRE><DL><DD>If true the queue is being closed and is currently in the process of  being flushed. All new "push" requests will be refused.<P><DL></DL></DL><HR><A NAME="dropOldestObject"><!-- --></A><H3>dropOldestObject</H3><PRE>protected boolean <B>dropOldestObject</B></PRE><DL><DD>When we need to drop objects, drop the oldest obj.<P><DL></DL></DL><HR><A NAME="numEnqueued"><!-- --></A><H3>numEnqueued</H3><PRE>protected long <B>numEnqueued</B></PRE><DL><DD>total number of objects which have been enqueued into this queue<P><DL></DL></DL><HR><A NAME="sumOfQueueSizesEnqueue"><!-- --></A><H3>sumOfQueueSizesEnqueue</H3><PRE>protected long <B>sumOfQueueSizesEnqueue</B></PRE><DL><DD>sum of queue sizes at enqueue time.<P><DL></DL></DL><HR><A NAME="numDequeued"><!-- --></A><H3>numDequeued</H3><PRE>protected long <B>numDequeued</B></PRE><DL><DD>total number of objects which have been dequeued from this queue<P><DL></DL></DL><HR><A NAME="sumOfQueueSizesDequeue"><!-- --></A><H3>sumOfQueueSizesDequeue</H3><PRE>protected long <B>sumOfQueueSizesDequeue</B></PRE><DL><DD>sum of queue sizes at dequeue time.<P><DL></DL></DL><HR><A NAME="numDropped"><!-- --></A><H3>numDropped</H3><PRE>protected long <B>numDropped</B></PRE><DL><DD>the number of objects we have dropped since we began working.<P><DL></DL></DL><HR><A NAME="nextDroppedWarn"><!-- --></A><H3>nextDroppedWarn</H3><PRE>protected long <B>nextDroppedWarn</B></PRE><DL><DD>absolute time in millis when it will be ok to display a obj about dropping objects. We throttle this so that there is a chance to do work rather than just always spewing warnings.<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="UnbiasedQueue()"><!-- --></A><H3>UnbiasedQueue</H3><PRE>public <B>UnbiasedQueue</B>()</PRE><DL><DD>Default constructor. 100 element LIFO queue which drops oldest element when full.<P></DL><HR><A NAME="UnbiasedQueue(int, boolean)"><!-- --></A><H3>UnbiasedQueue</H3><PRE>public <B>UnbiasedQueue</B>(int&nbsp;maxsize,                     boolean&nbsp;dropOldest)</PRE><DL><DD>Full featured constructor for creating a new UnBiasedQueue.<P><DT><B>Parameters:</B><DD><CODE>maxsize</CODE> - Queue will not grow larger than this size. Use  <CODE>Integer.MAX_VALUE</CODE> for "unbounded" queue size.<DD><CODE>dropOldest</CODE> - Controls behaviour of element insertion when the queue is full. If <tt>true</tt> and the queue is full upon a <A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#push(java.lang.Object)"><CODE>push</CODE></A> operation then the oldest element will be dropped to be replaced with the element currently being pushed. If <tt>false</tt> then the element will not be inserted if the queue is full.</DL><HR><A NAME="UnbiasedQueue(int, boolean, java.util.List)"><!-- --></A><H3>UnbiasedQueue</H3><PRE>public <B>UnbiasedQueue</B>(int&nbsp;maxsize,                     boolean&nbsp;dropOldest,                     java.util.List&nbsp;queue)</PRE><DL><DD>Full featured constructor for creating a new UnBiasedQueue.<P><DT><B>Parameters:</B><DD><CODE>maxsize</CODE> - Queue will not grow larger than this size. Use  <CODE>Integer.MAX_VALUE</CODE> for "unbounded" queue size.<DD><CODE>dropOldest</CODE> - Controls behaviour of element insertion when the  queue is full. If <tt>true</tt> and the queue is full upon a  <A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html#push(java.lang.Object)"><CODE>push</CODE></A> operation then the oldest element will be  dropped to be replaced with the element currently being pushed. If  <tt>false</tt> then the element will not be inserted if the queue is full.<DD><CODE>queue</CODE> - the List class instance to use. This does not need to be  a synchronized list class. (and it works more effciently if it isn't).</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="synchronizedQueue(net.jxta.impl.util.UnbiasedQueue)"><!-- --></A><H3>synchronizedQueue</H3><PRE>public static <A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A> <B>synchronizedQueue</B>(<A HREF="../../../../net/jxta/impl/util/UnbiasedQueue.html" title="class in net.jxta.impl.util">UnbiasedQueue</A>&nbsp;queue)</PRE><DL><DD>Returns a synchronized (thread-safe) list backed by the specified queue.  Most UnbiasedQueue subclasses are either unsynchronized or internally  synchronized. If you need to do any atomic operations upon  UnbiasedQueues (or subclasses) then this method should be used to  "wrap" the queue with synchronization.  <p/>In order to guarantee serial access, it is critical that all access to the backing queue is accomplished through the returned queue.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>queue</CODE> - the queue to be "wrapped" in a synchronized queue.</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>  <p/>A diagnostic toString implementation.<P><DD><DL></DL></DD></DL><HR><A NAME="isClosed()"><!-- --></A><H3>isClosed</H3><PRE>public boolean <B>isClosed</B>()</PRE><DL><DD>Atomically return whether or not this queue has been closed. Closed  queues will not accept "push" requests, but elements will still be  returned with "pop".<P>

⌨️ 快捷键说明

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