org.jbox2d.serialization.pb
Class PbSerializer

java.lang.Object
  extended by org.jbox2d.serialization.pb.PbSerializer
All Implemented Interfaces:
JbSerializer

public class PbSerializer
extends Object
implements JbSerializer

Protobuffer serializer implementation.

Author:
Daniel

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jbox2d.serialization.JbSerializer
JbSerializer.ObjectSigner
 
Constructor Summary
PbSerializer()
           
PbSerializer(JbSerializer.ObjectSigner argSigner)
           
PbSerializer(UnsupportedListener argListener)
           
PbSerializer(UnsupportedListener argListener, JbSerializer.ObjectSigner argSigner)
           
 
Method Summary
 SerializationResult serialize(org.jbox2d.dynamics.Body argBody)
          Serializes a body
 SerializationResult serialize(org.jbox2d.dynamics.Fixture argFixture)
          Serializes a fixture
 SerializationResult serialize(org.jbox2d.dynamics.joints.Joint argJoint, Map<org.jbox2d.dynamics.Body,Integer> argBodyIndexMap, Map<org.jbox2d.dynamics.joints.Joint,Integer> argJointIndexMap)
          Serializes joints.
 SerializationResult serialize(org.jbox2d.collision.shapes.Shape argShape)
          Serializes a shape
 SerializationResult serialize(org.jbox2d.dynamics.World argWorld)
          Serializes the world
 Box2D.PbBody.Builder serializeBody(org.jbox2d.dynamics.Body argBody)
           
 Box2D.PbFilter.Builder serializeFilter(org.jbox2d.dynamics.Filter argFilter)
           
 Box2D.PbFixture.Builder serializeFixture(org.jbox2d.dynamics.Fixture argFixture)
           
 Box2D.PbJoint.Builder serializeJoint(org.jbox2d.dynamics.joints.Joint joint, Map<org.jbox2d.dynamics.Body,Integer> argBodyIndexMap, Map<org.jbox2d.dynamics.joints.Joint,Integer> argJointIndexMap)
           
 Box2D.PbShape.Builder serializeShape(org.jbox2d.collision.shapes.Shape argShape)
           
 Box2D.PbWorld.Builder serializeWorld(org.jbox2d.dynamics.World argWorld)
           
 void setObjectSigner(JbSerializer.ObjectSigner argSigner)
          Sets the object signer for the serializer.
 void setUnsupportedListener(UnsupportedListener argListener)
          Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PbSerializer

public PbSerializer()

PbSerializer

public PbSerializer(UnsupportedListener argListener)

PbSerializer

public PbSerializer(JbSerializer.ObjectSigner argSigner)

PbSerializer

public PbSerializer(UnsupportedListener argListener,
                    JbSerializer.ObjectSigner argSigner)
Method Detail

setObjectSigner

public void setObjectSigner(JbSerializer.ObjectSigner argSigner)
Description copied from interface: JbSerializer
Sets the object signer for the serializer. This allows the user to specify an 'tag' for each main physics object, which is then referenced later at deserialization for the user.

Specified by:
setObjectSigner in interface JbSerializer

setUnsupportedListener

public void setUnsupportedListener(UnsupportedListener argListener)
Description copied from interface: JbSerializer
Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.

Specified by:
setUnsupportedListener in interface JbSerializer

serialize

public SerializationResult serialize(org.jbox2d.dynamics.World argWorld)
Description copied from interface: JbSerializer
Serializes the world

Specified by:
serialize in interface JbSerializer
Returns:
See Also:
JbSerializer.setUnsupportedListener(UnsupportedListener)

serializeWorld

public Box2D.PbWorld.Builder serializeWorld(org.jbox2d.dynamics.World argWorld)

serialize

public SerializationResult serialize(org.jbox2d.dynamics.Body argBody)
Description copied from interface: JbSerializer
Serializes a body

Specified by:
serialize in interface JbSerializer
Returns:
See Also:
JbSerializer.setUnsupportedListener(UnsupportedListener)

serializeBody

public Box2D.PbBody.Builder serializeBody(org.jbox2d.dynamics.Body argBody)

serialize

public SerializationResult serialize(org.jbox2d.dynamics.Fixture argFixture)
Description copied from interface: JbSerializer
Serializes a fixture

Specified by:
serialize in interface JbSerializer
Returns:
See Also:
JbSerializer.setUnsupportedListener(UnsupportedListener)

serializeFixture

public Box2D.PbFixture.Builder serializeFixture(org.jbox2d.dynamics.Fixture argFixture)

serialize

public SerializationResult serialize(org.jbox2d.collision.shapes.Shape argShape)
Description copied from interface: JbSerializer
Serializes a shape

Specified by:
serialize in interface JbSerializer
Returns:
See Also:
JbSerializer.setUnsupportedListener(UnsupportedListener)

serializeShape

public Box2D.PbShape.Builder serializeShape(org.jbox2d.collision.shapes.Shape argShape)

serialize

public SerializationResult serialize(org.jbox2d.dynamics.joints.Joint argJoint,
                                     Map<org.jbox2d.dynamics.Body,Integer> argBodyIndexMap,
                                     Map<org.jbox2d.dynamics.joints.Joint,Integer> argJointIndexMap)
Description copied from interface: JbSerializer
Serializes joints. Joints need to reference bodies and sometimes other joints.

Specified by:
serialize in interface JbSerializer
Returns:

serializeJoint

public Box2D.PbJoint.Builder serializeJoint(org.jbox2d.dynamics.joints.Joint joint,
                                            Map<org.jbox2d.dynamics.Body,Integer> argBodyIndexMap,
                                            Map<org.jbox2d.dynamics.joints.Joint,Integer> argJointIndexMap)

serializeFilter

public Box2D.PbFilter.Builder serializeFilter(org.jbox2d.dynamics.Filter argFilter)


Copyright © 2013. All Rights Reserved.