|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.util.buffer.FastBuffer<E>
public class FastBuffer<E>
Fast, fast E buffer with additional features.
| Constructor Summary | |
|---|---|
FastBuffer()
Creates a new E buffer. |
|
FastBuffer(int size)
Creates a new E buffer, with a buffer capacity of
the specified size, in bytes. |
|
| Method Summary | |
|---|---|
void |
add(E element)
Adds element to buffer. |
FastBuffer<E> |
append(E element)
Appends single E to buffer. |
FastBuffer<E> |
append(E[] array)
Appends E array to buffer. |
FastBuffer<E> |
append(E[] array,
int off,
int len)
Appends E array to buffer. |
FastBuffer<E> |
append(FastBuffer<E> buff)
Appends another fast buffer to this one. |
E[] |
array(int index)
Returns E inner array chunk at given index. |
void |
clear()
Resets the buffer content. |
E |
get(int index)
Returns E element at given index. |
int |
index()
Returns current index of inner E array chunk. |
boolean |
isEmpty()
Tests if this buffer has no elements. |
java.util.Iterator<E> |
iterator()
Returns an iterator over buffer elements. |
int |
offset()
Returns the offset of last used element in current inner array chunk. |
int |
size()
Returns buffer size. |
E[] |
toArray()
Creates E array from buffered content. |
E[] |
toArray(int start,
int len)
Creates E subarray from buffered content. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastBuffer()
E buffer. The buffer capacity is
initially 1024 bytes, though its size increases if necessary.
public FastBuffer(int size)
E buffer, with a buffer capacity of
the specified size, in bytes.
size - the initial size.
java.lang.IllegalArgumentException - if size is negative.| Method Detail |
|---|
public FastBuffer<E> append(E[] array,
int off,
int len)
E array to buffer.
public FastBuffer<E> append(E[] array)
E array to buffer.
public FastBuffer<E> append(E element)
E to buffer.
public FastBuffer<E> append(FastBuffer<E> buff)
public int size()
public boolean isEmpty()
public int index()
E array chunk.
Represents the index of last used inner array chunk.
public int offset()
public E[] array(int index)
E inner array chunk at given index.
May be used for iterating inner chunks in fast manner.
public void clear()
public E[] toArray()
E array from buffered content.
public E[] toArray(int start,
int len)
E subarray from buffered content.
public E get(int index)
E element at given index.
public void add(E element)
public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||