org.ehcache.impl.serialization
Class DoubleSerializer

java.lang.Object
  extended by org.ehcache.impl.serialization.DoubleSerializer
All Implemented Interfaces:
Serializer<java.lang.Double>

public class DoubleSerializer
extends java.lang.Object
implements Serializer<java.lang.Double>

Default Serializer for Double type. Simply writes the double value to a byte buffer.


Constructor Summary
DoubleSerializer()
           
DoubleSerializer(java.lang.ClassLoader classLoader)
           
DoubleSerializer(java.lang.ClassLoader classLoader, FileBasedPersistenceContext persistenceContext)
           
 
Method Summary
 boolean equals(java.lang.Double object, java.nio.ByteBuffer binary)
          Checks if the given instance and serial form are representations of the same instance.
 java.lang.Double read(java.nio.ByteBuffer binary)
          Reconstructs an instance from the given serial form.
 java.nio.ByteBuffer serialize(java.lang.Double object)
          Transforms the given instance into its serial form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleSerializer

public DoubleSerializer()

DoubleSerializer

public DoubleSerializer(java.lang.ClassLoader classLoader)

DoubleSerializer

public DoubleSerializer(java.lang.ClassLoader classLoader,
                        FileBasedPersistenceContext persistenceContext)
Method Detail

serialize

public java.nio.ByteBuffer serialize(java.lang.Double object)
Description copied from interface: Serializer
Transforms the given instance into its serial form.

Specified by:
serialize in interface Serializer<java.lang.Double>
Parameters:
object - the instance to serialize
Returns:
the binary representation of the serial form

read

public java.lang.Double read(java.nio.ByteBuffer binary)
                      throws java.lang.ClassNotFoundException
Description copied from interface: Serializer
Reconstructs an instance from the given serial form.

Specified by:
read in interface Serializer<java.lang.Double>
Parameters:
binary - the binary representation of the serial form
Returns:
the de-serialized instance
Throws:
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found

equals

public boolean equals(java.lang.Double object,
                      java.nio.ByteBuffer binary)
               throws java.lang.ClassNotFoundException
Description copied from interface: Serializer
Checks if the given instance and serial form are representations of the same instance.

Specified by:
equals in interface Serializer<java.lang.Double>
Parameters:
object - the instance to check
binary - the serial form to check
Returns:
true if both parameters represent the same instance, false otherwise
Throws:
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found