/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Returns a typed buffer backed by the given buffer. * <p> * Only elements of the specified type can be added to the buffer. * * @param buffer the buffer to predicate, must not be null * @param type the type to allow into the buffer, must not be null * @return a typed buffer * @throws IllegalArgumentException if the buffer or type is null */ public static Buffer typedBuffer(Buffer buffer, Class type) { return TypedBuffer.decorate(buffer, type); }
/** * Creates the buffer used as publish queue.<p> * * @return the queue buffer */ public static Buffer getQueue() { return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new UnboundedFifoBuffer() { /** The serialization version id constant. */ private static final long serialVersionUID = 606444342980861724L; /** * Called when the queue is full to remove the oldest element.<p> * * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove() */ @Override public Object remove() { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove(); return publishJob; } }, CmsPublishJobInfoBean.class)); }
/** * Creates the buffer used as publish queue.<p> * * @return the queue buffer */ public static Buffer getQueue() { return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new UnboundedFifoBuffer() { /** The serialization version id constant. */ private static final long serialVersionUID = 606444342980861724L; /** * Called when the queue is full to remove the oldest element.<p> * * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove() */ @Override public Object remove() { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove(); return publishJob; } }, CmsPublishJobInfoBean.class)); }
return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new CircularFifoBuffer(size) {
return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new CircularFifoBuffer(size) {