com.speckled.specksim.state
Interface SerializableState

All Known Implementing Classes:
BroadcastDetails, DefaultCommsModel.State, GravityEnvironment.State, SpeckledBodyModel.BodiesState

public interface SerializableState

Simulator state objects that implement this interface allow the state of the simulator to be captured for later consumption. This allows a host of time-shifting goodness

Author:
ryanm

Method Summary
 SerializableState decode(byte[] data)
          Decode the supplied data and construct a new state object from it.
 byte[] encode()
          Encode the data of this state object to a byte array, such that it may be decoded by decode( data )
 

Method Detail

encode

byte[] encode()
Encode the data of this state object to a byte array, such that it may be decoded by decode( data )

Returns:
The encoded data

decode

SerializableState decode(byte[] data)
                         throws java.io.IOException
Decode the supplied data and construct a new state object from it.

Parameters:
data - The data to decode. It was produced by the encode() method
Returns:
A new state object that contains the supplied data
Throws:
java.io.IOException