jconch.pipeline.impl
Class UnboundedPipeLink<T>
java.lang.Object
jconch.pipeline.PipeLink<T>
jconch.pipeline.impl.UnboundedPipeLink<T>
public class UnboundedPipeLink<T>
- extends PipeLink<T>
An unbounded link in the pipeline. This is a very fast implementation of a
link, but allows potentially unlimited elements to build up, which can be
counter-productive to the multithreaded approach.
View Source
- Version:
- $Date: May 10, 2007 8:07:29 AM $
- Author:
- rfischer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnboundedPipeLink
public UnboundedPipeLink()
- Creates a new intance of
UnboundedPipeLink.
getRemainingCapacity
public int getRemainingCapacity()
- Have to override this because
LinkedBlockingQueue.remainingCapacity() doesn't work as expected --
apparently an unbounded queue runs low on space after you insert
elements.
Provides an estimate of the number of elements the queue could
additionally hold.
- Overrides:
getRemainingCapacity in class PipeLink<T>
- Returns:
- An estimate of the capcity of the queue, or
Integer.MAX_VALUE if it is unbounded.