org.openbandy.io
Class SerializationBuffer

java.lang.Object
  extended by org.openbandy.io.SerializationBuffer
Direct Known Subclasses:
StorageSerializationBuffer, StreamSerializationBuffer

public class SerializationBuffer
extends java.lang.Object

The SerializationBuffer is a temporary reservoir for the attributes of every serializable object that is serialized/deserialized. Thus, it holds a collection of ValueContainers. Moreover, it must hold every stateful variables that is used during the serialization/deserialization process.

(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.

Version:
1.0
Author:
Philipp Bolliger (philipp@bolliger.name)

Constructor Summary
SerializationBuffer()
           
 
Method Summary
 void addContainer(ValueContainer container)
          Add a new container to the buffer.container().
 ValueContainer container()
          Returns the current container object.
 java.util.Vector getValueContainers()
          Returns the vector containing all value container objects.
 void removeContainer(ValueContainer container)
          Removes the given container from the list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializationBuffer

public SerializationBuffer()
Method Detail

getValueContainers

public java.util.Vector getValueContainers()
Returns the vector containing all value container objects. Might return null if the serialization buffer has not been initialized.

Returns:
Vector of all ValueContainer objects.

container

public ValueContainer container()
Returns the current container object. If no container exists, the method returns null.

Returns:
The current ValueContainer.

addContainer

public void addContainer(ValueContainer container)
Add a new container to the buffer.container(). After adding, this will be the current buffer.container().

Parameters:
container - New buffer.container().

removeContainer

public void removeContainer(ValueContainer container)
Removes the given container from the list. If it was the currentContainer (i.e. the last added), the previous last is taken as current.

Parameters:
container - The container that will be removed.