1 16 package org.apache.commons.collections; 17 18 import org.apache.commons.collections.buffer.BlockingBuffer; 19 import org.apache.commons.collections.buffer.PredicatedBuffer; 20 import org.apache.commons.collections.buffer.SynchronizedBuffer; 21 import org.apache.commons.collections.buffer.TransformedBuffer; 22 import org.apache.commons.collections.buffer.TypedBuffer; 23 import org.apache.commons.collections.buffer.UnmodifiableBuffer; 24 25 34 public class BufferUtils { 35 36 39 public static final Buffer EMPTY_BUFFER = UnmodifiableBuffer.decorate(new ArrayStack(1)); 40 41 44 public BufferUtils() { 45 } 46 47 68 public static Buffer synchronizedBuffer(Buffer buffer) { 69 return SynchronizedBuffer.decorate(buffer); 70 } 71 72 84 public static Buffer blockingBuffer(Buffer buffer) { 85 return BlockingBuffer.decorate(buffer); 86 } 87 88 95 public static Buffer unmodifiableBuffer(Buffer buffer) { 96 return UnmodifiableBuffer.decorate(buffer); 97 } 98 99 112 public static Buffer predicatedBuffer(Buffer buffer, Predicate predicate) { 113 return PredicatedBuffer.decorate(buffer, predicate); 114 } 115 116 126 public static Buffer typedBuffer(Buffer buffer, Class type) { 127 return TypedBuffer.decorate(buffer, type); 128 } 129 130 142 public static Buffer transformedBuffer(Buffer buffer, Transformer transformer) { 143 return TransformedBuffer.decorate(buffer, transformer); 144 } 145 146 } 147 | Popular Tags |