make/tools/CharsetMapping/DoubleByte-X.java.template

Print this page




  37 public class $NAME_CLZ$ extends Charset
  38                         $IMPLEMENTS$
  39 {
  40     public $NAME_CLZ$() {
  41         super("$NAME_CS$", $NAME_ALIASES$);
  42     }
  43 
  44     $HISTORICALNAME$
  45 
  46     public boolean contains(Charset cs) {
  47         $CONTAINS$
  48     }
  49 
  50     public CharsetDecoder newDecoder() {
  51         initb2c();
  52         return new  DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$);
  53     }
  54 
  55     public CharsetEncoder newEncoder() {
  56         initc2b();
  57         return new DoubleByte.Encoder$ENCTYPE$(this, c2b, c2bIndex);
  58     }
  59 
  60     $B2C$
  61     static char[][] b2c = new char[b2cStr.length][];
  62     static char[] b2cSB;
  63     private static volatile boolean b2cInitialized = false;
  64 
  65     static void initb2c() {
  66         if (b2cInitialized)
  67             return;
  68         synchronized (b2c) {
  69             if (b2cInitialized)
  70                 return;
  71             for (int i = 0; i < b2cStr.length; i++) {
  72                 if (b2cStr[i] == null)
  73                     b2c[i] = DoubleByte.B2C_UNMAPPABLE;
  74                 else
  75                     b2c[i] = b2cStr[i].toCharArray();
  76             }
  77             b2cSB = b2cSBStr.toCharArray();




  37 public class $NAME_CLZ$ extends Charset
  38                         $IMPLEMENTS$
  39 {
  40     public $NAME_CLZ$() {
  41         super("$NAME_CS$", $NAME_ALIASES$);
  42     }
  43 
  44     $HISTORICALNAME$
  45 
  46     public boolean contains(Charset cs) {
  47         $CONTAINS$
  48     }
  49 
  50     public CharsetDecoder newDecoder() {
  51         initb2c();
  52         return new  DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$);
  53     }
  54 
  55     public CharsetEncoder newEncoder() {
  56         initc2b();
  57         return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ c2b, c2bIndex); 
  58     }
  59 
  60     $B2C$
  61     static char[][] b2c = new char[b2cStr.length][];
  62     static char[] b2cSB;
  63     private static volatile boolean b2cInitialized = false;
  64 
  65     static void initb2c() {
  66         if (b2cInitialized)
  67             return;
  68         synchronized (b2c) {
  69             if (b2cInitialized)
  70                 return;
  71             for (int i = 0; i < b2cStr.length; i++) {
  72                 if (b2cStr[i] == null)
  73                     b2c[i] = DoubleByte.B2C_UNMAPPABLE;
  74                 else
  75                     b2c[i] = b2cStr[i].toCharArray();
  76             }
  77             b2cSB = b2cSBStr.toCharArray();