org.exoplatform.commons.utils
Class TableCharEncoder

java.lang.Object
  extended by org.exoplatform.commons.utils.TableCharEncoder
All Implemented Interfaces:
CharEncoder

public class TableCharEncoder
extends Object
implements CharEncoder

A char encoder that use a table to cache the result produced by a delegate char encoder. This encoder is stateless and should only be composed with stateless char encoder otherwise an unexpected result may happen.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
TableCharEncoder(CharEncoder charEncoder)
          Creates a new table based char encoder.
 
Method Summary
 byte[] encode(char c)
          Encodes a single char into an array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableCharEncoder

public TableCharEncoder(CharEncoder charEncoder)
Creates a new table based char encoder.

Parameters:
charEncoder - the delegate char encoder
Method Detail

encode

public byte[] encode(char c)
Description copied from interface: CharEncoder
Encodes a single char into an array of bytes. The returned array of bytes should not be modified.

Specified by:
encode in interface CharEncoder
Parameters:
c - the char to encode
Returns:
the serie of bytes corresponding to the encoded char


Copyright © 2009 eXo Platform SAS. All Rights Reserved.