org.apache.avalon.excalibur.collections
クラス VariableSizeBuffer
java.lang.Object
|
+--org.apache.avalon.excalibur.collections.VariableSizeBuffer
- すべての実装インタフェース:
- Buffer
- public final class VariableSizeBuffer
- extends java.lang.Object
- implements Buffer
VariableSizeBuffer is a very efficient buffer implementation.
According to performance testing, it exhibits a constant access time, but it
also outperforms ArrayList when used for the same purpose.
- 導入されたバージョン:
- 4.0
- バージョン:
- CVS $Revision: 1.2 $ $Date: 2002/01/08 18:06:07 $
- 作成者:
- Federico Barbieri, Berin Loritsch
コンストラクタの概要 |
VariableSizeBuffer()
Initialize the VariableSizeBuffer with the default number of elements. |
VariableSizeBuffer(int size)
Initialize the VariableSizeBuffer with the specified number of elements. |
メソッドの概要 |
void |
add(java.lang.Object o)
Add an object into the buffer |
boolean |
isEmpty()
Tests to see if the CircularBuffer is empty. |
java.lang.Object |
remove()
Removes the next object from the buffer |
int |
size()
Returns the number of elements stored in the buffer. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_buffer
protected java.lang.Object[] m_buffer
m_head
protected int m_head
m_tail
protected int m_tail
VariableSizeBuffer
public VariableSizeBuffer(int size)
- Initialize the VariableSizeBuffer with the specified number of elements. The
integer must be a positive integer.
VariableSizeBuffer
public VariableSizeBuffer()
- Initialize the VariableSizeBuffer with the default number of elements. It is
exactly the same as performing the following:
new VariableSizeBuffer( 32 );
isEmpty
public final boolean isEmpty()
- Tests to see if the CircularBuffer is empty.
- 定義:
- インタフェース
Buffer
内の isEmpty
size
public final int size()
- Returns the number of elements stored in the buffer.
- 定義:
- インタフェース
Buffer
内の size
add
public final void add(java.lang.Object o)
- Add an object into the buffer
- 定義:
- インタフェース
Buffer
内の add
- インタフェース
org.apache.avalon.excalibur.collections.Buffer
からコピーされたタグ:
- 例外:
BufferOverflowException
- if adding this element exceeds the
buffer's capacity.
remove
public java.lang.Object remove()
- Removes the next object from the buffer
- 定義:
- インタフェース
Buffer
内の remove
- インタフェース
org.apache.avalon.excalibur.collections.Buffer
からコピーされたタグ:
- 例外:
BufferUnderflowException
- if the buffer is already empty
"Copyright ? 2001 Apache Jakarta Project. All Rights Reserved."