net.rubyeye.xmemcached.transcoders
Class TokyoTyrantTranscoder

java.lang.Object
  extended by net.rubyeye.xmemcached.transcoders.TokyoTyrantTranscoder
All Implemented Interfaces:
Transcoder<java.lang.Object>

public class TokyoTyrantTranscoder
extends java.lang.Object
implements Transcoder<java.lang.Object>

Transcoder for TokyoTyrant.Add 4-bytes flag before value.

Author:
boyan

Constructor Summary
TokyoTyrantTranscoder()
           
TokyoTyrantTranscoder(int maxSize)
           
 
Method Summary
 java.lang.Object decode(CachedData d)
          Decode the cached object into the object it represents.
 CachedData encode(java.lang.Object o)
          Encode the given object for storage.
 int getMaxSize()
           
 boolean isPackZeros()
           
 boolean isPrimitiveAsString()
           
 void setCharset(java.lang.String to)
           
 void setCompressionThreshold(int to)
           
 void setPackZeros(boolean packZeros)
          Set whether pack zeros
 void setPrimitiveAsString(boolean primitiveAsString)
          Set whether store primitive type as string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokyoTyrantTranscoder

public TokyoTyrantTranscoder(int maxSize)

TokyoTyrantTranscoder

public TokyoTyrantTranscoder()
Method Detail

decode

public final java.lang.Object decode(CachedData d)
Description copied from interface: Transcoder
Decode the cached object into the object it represents.

Specified by:
decode in interface Transcoder<java.lang.Object>
Parameters:
d - the data
Returns:
the return value

encode

public final CachedData encode(java.lang.Object o)
Description copied from interface: Transcoder
Encode the given object for storage.

Specified by:
encode in interface Transcoder<java.lang.Object>
Parameters:
o - the object
Returns:
the CachedData representing what should be sent

getMaxSize

public final int getMaxSize()

isPackZeros

public boolean isPackZeros()
Specified by:
isPackZeros in interface Transcoder<java.lang.Object>

isPrimitiveAsString

public boolean isPrimitiveAsString()
Specified by:
isPrimitiveAsString in interface Transcoder<java.lang.Object>

setCharset

public void setCharset(java.lang.String to)

setCompressionThreshold

public void setCompressionThreshold(int to)
Specified by:
setCompressionThreshold in interface Transcoder<java.lang.Object>

setPackZeros

public void setPackZeros(boolean packZeros)
Description copied from interface: Transcoder
Set whether pack zeros

Specified by:
setPackZeros in interface Transcoder<java.lang.Object>

setPrimitiveAsString

public void setPrimitiveAsString(boolean primitiveAsString)
Description copied from interface: Transcoder
Set whether store primitive type as string.

Specified by:
setPrimitiveAsString in interface Transcoder<java.lang.Object>


Copyright © 2011. All Rights Reserved.