net.rubyeye.xmemcached.transcoders
Class WhalinTranscoder

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

public class WhalinTranscoder
extends BaseSerializingTranscoder
implements Transcoder<java.lang.Object>

Transcoder that provides compatibility with Greg Whalin's memcached client.


Field Summary
static int COMPRESSED
           
static int SERIALIZED
           
static int SPECIAL_BOOLEAN
           
static int SPECIAL_BYTE
           
static int SPECIAL_BYTEARRAY
           
static int SPECIAL_CHARACTER
           
static int SPECIAL_DATE
           
static int SPECIAL_DOUBLE
           
static int SPECIAL_FLOAT
           
static int SPECIAL_INT
           
static int SPECIAL_LONG
           
static int SPECIAL_SHORT
           
static int SPECIAL_STRING
           
static int SPECIAL_STRINGBUFFER
           
static int SPECIAL_STRINGBUILDER
           
 
Fields inherited from class net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
charset, compressionThreshold, DEFAULT_CHARSET, DEFAULT_COMPRESSION_THRESHOLD, log
 
Constructor Summary
WhalinTranscoder()
           
WhalinTranscoder(int maxSize)
           
 
Method Summary
 java.lang.Object decode(CachedData d)
          Decode the cached object into the object it represents.
 boolean decodeBoolean(byte[] in)
           
protected  java.lang.Character decodeCharacter(byte[] b)
           
 CachedData encode(java.lang.Object o)
          Encode the given object for storage.
 byte[] encodeBoolean(boolean b)
           
 int getMaxSize()
           
 boolean isPackZeros()
           
 boolean isPrimitiveAsString()
           
 void setMaxSize(int maxSize)
           
 void setPackZeros(boolean packZeros)
          Set whether pack zeros
 void setPrimitiveAsString(boolean primitiveAsString)
          Set whether store primitive type as string.
 
Methods inherited from class net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
compress, decodeString, decompress, deserialize, encodeString, serialize, setCharset, setCompressionThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rubyeye.xmemcached.transcoders.Transcoder
setCompressionThreshold
 

Field Detail

SPECIAL_BYTE

public static final int SPECIAL_BYTE
See Also:
Constant Field Values

SPECIAL_BOOLEAN

public static final int SPECIAL_BOOLEAN
See Also:
Constant Field Values

SPECIAL_INT

public static final int SPECIAL_INT
See Also:
Constant Field Values

SPECIAL_LONG

public static final int SPECIAL_LONG
See Also:
Constant Field Values

SPECIAL_CHARACTER

public static final int SPECIAL_CHARACTER
See Also:
Constant Field Values

SPECIAL_STRING

public static final int SPECIAL_STRING
See Also:
Constant Field Values

SPECIAL_STRINGBUFFER

public static final int SPECIAL_STRINGBUFFER
See Also:
Constant Field Values

SPECIAL_FLOAT

public static final int SPECIAL_FLOAT
See Also:
Constant Field Values

SPECIAL_SHORT

public static final int SPECIAL_SHORT
See Also:
Constant Field Values

SPECIAL_DOUBLE

public static final int SPECIAL_DOUBLE
See Also:
Constant Field Values

SPECIAL_DATE

public static final int SPECIAL_DATE
See Also:
Constant Field Values

SPECIAL_STRINGBUILDER

public static final int SPECIAL_STRINGBUILDER
See Also:
Constant Field Values

SPECIAL_BYTEARRAY

public static final int SPECIAL_BYTEARRAY
See Also:
Constant Field Values

COMPRESSED

public static final int COMPRESSED
See Also:
Constant Field Values

SERIALIZED

public static final int SERIALIZED
See Also:
Constant Field Values
Constructor Detail

WhalinTranscoder

public WhalinTranscoder()

WhalinTranscoder

public WhalinTranscoder(int maxSize)
Method Detail

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>

getMaxSize

public final int getMaxSize()

setMaxSize

public final void setMaxSize(int maxSize)

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>

decode

public 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 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

decodeCharacter

protected java.lang.Character decodeCharacter(byte[] b)

encodeBoolean

public byte[] encodeBoolean(boolean b)

decodeBoolean

public boolean decodeBoolean(byte[] in)


Copyright © 2011. All Rights Reserved.