/** * Returns an unmodifiable buffer backed by the given buffer. * * @param buffer the buffer to make unmodifiable, must not be null * @return an unmodifiable buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null */ public static Buffer unmodifiableBuffer(Buffer buffer) { return UnmodifiableBuffer.decorate(buffer); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Returns an unmodifiable buffer backed by the given buffer. * * @param buffer the buffer to make unmodifiable, must not be null * @return an unmodifiable buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null */ public static Buffer unmodifiableBuffer(Buffer buffer) { return UnmodifiableBuffer.decorate(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
public Collection makeCollection() { return UnmodifiableBuffer.decorate(new UnboundedFifoBuffer()); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
public Collection makeFullCollection() { Buffer buffer = new UnboundedFifoBuffer(); buffer.addAll(Arrays.asList(getFullElements())); return UnmodifiableBuffer.decorate(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Returns an unmodifiable buffer backed by the given buffer. * * @param buffer the buffer to make unmodifiable, must not be null * @return an unmodifiable buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null */ public static Buffer unmodifiableBuffer(Buffer buffer) { return UnmodifiableBuffer.decorate(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Returns an unmodifiable buffer backed by the given buffer. * * @param buffer the buffer to make unmodifiable, must not be null * @return an unmodifiable buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null */ public static Buffer unmodifiableBuffer(Buffer buffer) { return UnmodifiableBuffer.decorate(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }
/** * Factory method to create an unmodifiable buffer. * <p> * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { if (buffer instanceof Unmodifiable) { return buffer; } return new UnmodifiableBuffer(buffer); }
/** * Returns an unmodifiable buffer backed by the given buffer. * * @param buffer the buffer to make unmodifiable, must not be null * @return an unmodifiable buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null */ public static Buffer unmodifiableBuffer(Buffer buffer) { return UnmodifiableBuffer.decorate(buffer); }
public Iterator iterator() { return UnmodifiableIterator.decorate(getCollection().iterator()); }