net.beadsproject.beads.data
Class BufferFactory

java.lang.Object
  extended by net.beadsproject.beads.data.BufferFactory
Direct Known Subclasses:
HanningWindow, SawBuffer, SineBuffer, SquareBuffer

public abstract class BufferFactory
extends java.lang.Object

Abstract base class for factories that generate Buffers. Create subclasses of BufferFactory to generate different types of Buffer.

Author:
ollie
See Also:
Buffer

Field Summary
static int DEFAULT_BUFFER_SIZE
          The Constant DEFAULT_BUFFER_SIZE.
 
Constructor Summary
BufferFactory()
           
 
Method Summary
abstract  Buffer generateBuffer(int bufferSize)
          Subclasses should override this method to generate a Buffer of the specified size.
 Buffer getDefault()
          Generates a buffer using DEFAULT_BUFFER_SIZE and the BufferFactory's default name.
abstract  java.lang.String getName()
          Subclasses should override this method to generate a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
The Constant DEFAULT_BUFFER_SIZE.

See Also:
Constant Field Values
Constructor Detail

BufferFactory

public BufferFactory()
Method Detail

generateBuffer

public abstract Buffer generateBuffer(int bufferSize)
Subclasses should override this method to generate a Buffer of the specified size.

Parameters:
bufferSize - the buffer size.
Returns:
the buffer.

getName

public abstract java.lang.String getName()
Subclasses should override this method to generate a name. A default name should always be available for the case where getDefault() is called.

Returns:
the name of the buffer.

getDefault

public final Buffer getDefault()
Generates a buffer using DEFAULT_BUFFER_SIZE and the BufferFactory's default name.

Returns:
the default Buffer.