Module com.github.akurilov.commons
Class LimitedQueueBuffer<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.collection.LimitedQueueBuffer<T>
-
-
Constructor Summary
Constructors Constructor Description LimitedQueueBuffer(java.util.concurrent.BlockingQueue<T> queue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Does nothingTget()Non-blocking get implementationintget(java.util.List<T> buffer, int maxCount)Non-blocking bulk get implementationLimitedQueueBuffer<T>getInput()Make aInputinstance from this.booleanisEmpty()intput(java.util.List<T> items)intput(java.util.List<T> buffer, int from, int to)Non-blocking bulk put implementationbooleanput(T item)Non-blocking put implementationvoidreset()Does nothingintsize()longskip(long itemsCount)Skip some items.java.lang.StringtoString()
-
-
-
Field Detail
-
queue
protected final java.util.concurrent.BlockingQueue<T> queue
-
-
Constructor Detail
-
LimitedQueueBuffer
public LimitedQueueBuffer(java.util.concurrent.BlockingQueue<T> queue)
-
-
Method Detail
-
put
public boolean put(T item)
Non-blocking put implementation
-
put
public int put(java.util.List<T> buffer, int from, int to) throws java.io.IOException
Non-blocking bulk put implementation
-
put
public final int put(java.util.List<T> items) throws java.io.IOException
-
getInput
public LimitedQueueBuffer<T> getInput() throws java.io.IOException
Description copied from interface:OutputMake aInputinstance from this.
-
get
public T get() throws java.io.IOException
Non-blocking get implementation
-
get
public int get(java.util.List<T> buffer, int maxCount) throws java.io.IOException
Non-blocking bulk get implementation
-
skip
public long skip(long itemsCount) throws java.io.IOExceptionDescription copied from interface:InputSkip some items.
-
isEmpty
public final boolean isEmpty()
-
size
public final int size()
-
reset
public void reset() throws java.io.IOExceptionDoes nothing
-
close
public void close() throws java.io.IOExceptionDoes nothing- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException- doesn't throw
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-